Mappings that boost vim command line mode.
The goal is to have mappings similar to bash emacs mode.
You can read more about this idea in vim's docs
:h tcsh-style.
Plugin killer feature are convenient M-f and M-b CLI mappings that move one
"word" right or left (notice the lowercase "word").
This is an enhancement from vanilla vim that enables only "WORD" (uppercase)
left or right with
<S-Left> and <S-Right>.
Works in NeoVim too.
All mappings work only in vim command line mode.
C-ago to the beginning of the lineC-fgo one character right or fall back to c_CTRL-F at the end of the lineC-bgo one character leftC-ddelete character or fall back to c_CTRL-D at the end of the lineC-kclear line after the cursor, overrides c_CTRL-K (if you're usingC-kfor digraphs check the docs how to disable)C-x C-eopen the command-line window, same as c_CTRL-fM-f(Alt-f) go one "word" rightM-b(Alt-b) go one "word" leftM-d(Alt-d) delete "word" after the cursorM-BS(Alt-Backspace) delete "word" before the cursor, same as c_CTRL-WM-#(Alt-shift-3) insert comment at the beginning of the line and execute it. Useful for discarding the line, but still keeping it in the command-line history for later retrieval.
-
Vundle
Plugin 'vim-utils/vim-husk' -
vim-plug
Plug 'vim-utils/vim-husk' -
Pathogen
git clone git://github.com/vim-utils/vim-husk.git ~/.vim/bundle/vim-husk
Note: In order to enable alt mappings (M-f, M-b etc) Mac OS users using
Terminal.app may need to go to Preferences > Profiles > Keyboard and tick
"Use Option as Meta key".
vim-husk grew out from Tim Pope's vim-rsi
plugin. C-f, C-d and M-BS mappings are directly copied.
Differences:
vim-huskhas properM-f,M-bandM-dmapping implementation- with
vim-huskthere's no risk of breaking vim's macros. Link to related vim-rsi issue. vim-rsihas a broader scope and providesinsertandnormalmode mappings whilevim-huskfocuses only on vim's CLI.