Ⅰ. 插件描述
Navigation mode for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'fcpg/vim-navmode'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'fcpg/vim-navmode'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'fcpg/vim-navmode'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/fcpg/vim-navmode
Ⅳ. 文档说明
Vim-navmode
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.
HowTo
- 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.
Key Bindings
Map the Navmode() function in your .vimrc Eg.:
nmap ]j :call Navmode('j')<cr>
nmap ]k :call Navmode('k')<cr> Installation
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
~/.vimdirectory
Help
Run :helptags (or :Helptags with Pathogen), then :help navmode