Plugin for cleaning up the default key mappings and plugins in Neovim leaving only the bare essentials to build upon.
It provides only 2 functions:
clean_plugins()
: disables most nonessential builtin Neovim providers and plugins, such as, netrw, zipPlugin, matchit, etc. (see the full list in the code)clean_keymap()
: maps most of Neovim builtin keymaps to <Nop>
leaving (subjectively) only essential functionality:hjkl
, as well as word movements webWEB
^$
, as well as top gg
and bottom G
movementsvV<C-v>
, as well as Ex command mode :
aioAIO
and exit <Esc>
/
with next/previous jumps nN
yY
(together with line yank yy
) and paste pP
xX
, text deletions dD
(together with line delete dd
)cC
(together with line change cc
), as well as char replace r
and text replace R
u
and redo <C-r>
, as well as next/previous jumplist movements <C-o><C-i>
Neovim is a powerful text editor with a lot of functionality - the index consists of several hundred of commands. This plugin narrows it down to a few dozen most used commands, which may be beneficial for the following reasons:
q:
instead of :q
Load 'clean.nvim' as any other Neovim plugin using your favourite package manager.
The plugin provides only 2 functions, which can called together towards the start of your init file (in order not to overwrite any previous keymaps or global options):
require('clean').clean_keymap()
require('clean').clean_plugins()
In order to re-enable a command either delete the keymap or map it to something else (including itself) explicitly:
vim.keymap.del('', 'f')
vim.keymap.set('', 't', 't')
Note, that re-enabling multi-key commands may require re-enabling their prefixes as well, i.e., to use zz
you should have:
vim.keymap.del('n', 'z')
vim.keymap.del('n', 'zz')
In order to re-enable a plugin simply reset the corresponding variable to nil
afterwards, for example,
vim.g.editorconfig = nil