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-a
go to the beginning of the lineC-f
go one character right or fall back to c_CTRL-F at the end of the lineC-b
go one character leftC-d
delete character or fall back to c_CTRL-D at the end of the lineC-k
clear line after the cursor, overrides c_CTRL-K (if you're usingC-k
for digraphs check the docs how to disable)C-x C-e
open 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-husk
has properM-f
,M-b
andM-d
mapping implementation- with
vim-husk
there's no risk of breaking vim's macros. Link to related vim-rsi issue. vim-rsi
has a broader scope and providesinsert
andnormal
mode mappings whilevim-husk
focuses only on vim's CLI.