Skip navigation.

crocodile's blog

a python lover

已经在编辑状态(insert mode)了,如何快速执行 normal mode 的命令?

在编辑文本时,需要快速定位到某个位置,如下一个 d 的位置,难道要
<ESC>、fd、i 这般繁琐吗?
其实,使用 Ctrl-o(字母o) 就可以临时切换到 normal mode, 执行一个命令后自动返回 insert mode。
于是上述命令序列可以改为:
Ctrl-o、fd 即可。
Ctrl-o 要按两个键呢,很麻烦,于是来个 keymap
" make ` functions <C-O> in insert mode
inoremap ` <C-O>
nnoremap ` i`<ESC>

在 normal mode 下按 ` (左上角那个),会正常插入 `,
而在 insert mode 下则相当于按 Ctrl-O,
于是上述命令序列又可简化为
`fd 即可。
在 insert mode 想粘贴剪贴板内容时,可以输入 `P,爽吧?
这样就可以在 insert mode 下天马行空,不用再按 <ESC>和a 切来切去了。

使用links方式安装eclipse插件vim中文手册

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

December 2009
S M T W T F S
November 2009January 2010
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31