Chinaunix首页 | 论坛 | 博客
  • 博客访问: 28014
  • 博文数量: 8
  • 博客积分: 2099
  • 博客等级: 大尉
  • 技术积分: 85
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-04 14:23
文章分类

全部博文(8)

文章存档

2010年(4)

2009年(4)

我的朋友

分类: LINUX

2010-04-29 12:45:59

VIM中大部分命令的通用模式:
(number)(command)(text object)

其中:
number :执行次数
command :命令
text object :位置

具体如下:
命令
h …move left
l …move right
j …move up
k …move down
d …delete the characters from the cursor position up the position given by the next command (for example d$ deletes all character from the current cursor position up to the last column of the line).
c …change the character from the cursor position up to the position indicated by the next command.
x …delete the character under the cursor.
X …delete the character before the cursor (Backspace).
y …copy the characters from the current cursor position up to the position indicated by the next command.
p …paste previous deleted or yanked (copied) text after the current cursor position.
P …paste previous deleted or yanked (copied) text before the current cursor position.
r …replace the current character with the newly typed one.
s …substitute the text from the current cursor position up to the position given by the next command with the newly typed one.
. …repeat the last insertion or editing command (x,d,p…).

位置
text object.png
0 …first column of the line
^ …first non-blank character of the line
w …jump to next word
W …jump to next word, ignore punctuation
e …jump to word-end
E …jump to word-end, ignore punctuation
b …jump to word-beginning
B …jump to word-beginning, ignore punctuation
ge …jump to previous word-ending
gE …jump to previous word-ending, ignore punctuation
g_ …jump to last non-blank character of the line
$ …jump to the last character of the line


举例:
Change     Delete        Copy          from Cursor to ...
cH           dH            yH            top of screen
cL           dL            yL            bottom of screen
c+           d+            y+            next line
c5|          d5|           y5|           column 5 of current line
2c)          2d)           2y)           second sentence following
c{           d{            y{            previous paragraph
c/pattern   d/pattern  y/pattern         pattern
cn           dn            yn            next pattern
cG           dG            yG            end of file
c13G         d13G          y13G          line number 13
阅读(1070) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~