(Turn) to vim custom shortcuts

 

Too lazy to typesetting, please see the original: http://www.pythonclub.org/linux/vim/map

 

Well written

 

//在你的vimrc文件中增加像如下这样格式的key bindings
//格式为:
//模式 <快捷键> 要执行的命令
//模式:看下表,nmap为普通模式,imap为编辑模式
//C表示ctrl,A表示Alt,S表示Shift,<CR>表示回车

//比如下面这行表示在“正常||可视化||运算”模式下,按下Ctrl+W,则执行命令“:tabclose并回车”,就是关闭当前标签页
map <C-w> :tabclose<CR>

//又比如这行表示在“正常模式”下,按下Ctrl+t,
//则依次执行:browse(打开选择文件对话框) tabnew将选定的文件在新标签页中打开
nmap <C-t> :browse tabnew<CR>


//下面这行和上面一样,只是先用Esc从编辑模式切换到正常模式
imap <C-t> <Esc>:browse tabnew<CR>
 

 

Vim has three modes, a normal mode (Normal), insert mode (insert) and visual mode (visual).

Normal mode can execute commands. By default, Vim starts will enter this mode.
Insertion can insert text mode.
Visual mode can visually select a piece of text, and then execute a command or operation only for this text.

Press v Visual mode is started.
Use the arrow keys or the move command to select text.
Press c to modify the text. (Not like)

 

For example, use the following command to specify the F10 key to create a new tab:

:map <F10> <Esc>:tabnew<CR>

 

 

Wherein: <Esc> Representative Escape key; <CR> Representative Enter key; the function keys are indicated by <F10>. First, enter the command line mode, then execute the New tab: tabnew command, and finally return to normal mode.

Similarly: For the key combination can be used to <C-Esc> Representative Ctrl-Esc; using <S-F1> represents Shift-F1. For Mac users can use <D> Command key representatives.

Note: Alt key using <M-key> or <A-key> is represented.

For details on keyboard symbols, use: h key-notation command to view help information

Reproduced in: https: //my.oschina.net/uniquejava/blog/225018

Guess you like

Origin blog.csdn.net/weixin_34365635/article/details/92505519