Navigation mode for Vim.
__ __ __
/\ \/\ \ /\ \
\ \ `\\ \ __ __ __ ___ ___ ___ \_\ \ __
\ \ , ` \ /'__`\ /\ \/\ \ /' __` __`\ / __`\ /'_` \ /'__`\
\ \ \`\ \/\ \L\.\_\ \ \_/ |/\ \/\ \/\ \/\ \L\ \/\ \L\ \/\ __/
\ \_\ \_\ \__/.\_\\ \___/ \ \_\ \_\ \_\ \____/\ \___,_\ \____\
\/_/\/_/\/__/\/_/ \/__/ \/_/\/_/\/_/\/___/ \/__,_ /\/____/
Why would you want a "navigation mode"?
Because Vim is about modal editing, so as to avoid relegating all commands
to Control-Shift-Meta-Alt-AltGr-LeftPedal modifiers. It turns out that
navigation is an unfortunate source of repeated "chords" (keystrokes with
modifier): <C-d>
, <C-u>
, <Shift-g>
, <C-e>
, <C-y>
...
So navmode lets you move around with single keystrokes, from the comfort of your home row.
- Map the
Navmode()
function to some convenient key(s) - Press that key to start navigation mode
- Move around with u/d, j/k, e/y, t/b
- Set marks and jumps to marks with m/'
- Return to normal mode with
<Space>
, or jump back to where you started with<Backspace>
. Or use any other key (eg.:
) to exit and execute that command in normal mode.
Map the Navmode()
function in your .vimrc
Eg.:
nmap ]j :call Navmode('j')<cr>
nmap ]k :call Navmode('k')<cr>
Use your favorite method:
- Pathogen -
git clone https://github.com/fcpg/vim-navmode ~/.vim/bundle/vim-navmode
- NeoBundle -
NeoBundle 'fcpg/vim-navmode'
- Vundle -
Plugin 'fcpg/vim-navmode'
- manual - copy all of the files into your
~/.vim
directory
Run :helptags
(or :Helptags
with Pathogen), then :help navmode