所有的命令所在位置:/usr/share/vim/vim72/doc;
可以通过 find /usr/share/vim -name help.txt (其中一个文档)
1.到某一行
*G*
G Goto line [count], default last line, on the first
non-blank character |linewise|. If 'startofline' not
set, keep the same column.
*<C-End>*
<C-End> Goto line [count], default last line, on the last
character |inclusive|. {not in Vi}
<C-Home> or *gg* *<C-Home>*
gg Goto line [count], default first line, on the first
non-blank character |linewise|. If 'startofline' not
set, keep the same column.
例如跳转到第三行,3G 或者3gg.
2.复制
["x]y{motion} Yank {motion} text [into register x]. When no
characters are to be yanked (e.g., "y0" in column 1),
this is an error when 'cpoptions' includes the 'E'
flag.
*yy*
["x]yy Yank [count] lines [into register x] |linewise|.
*Y*
["x]Y yank [count] lines [into register x] (synonym for
yy, |linewise|). If you like "Y" to work from the
cursor to the end of line (which is more logical,
but not Vi-compatible) use ":map Y y$".
3.黏贴
["x]p Put the text [from register x] after the cursor
[count] times. {Vi: no count}
*P*
["x]P Put the text [from register x] before the cursor
[count] times. {Vi: no count}
4.删除
["x]<Del> or *<Del>* *x* *dl*
["x]x Delete [count] characters under and after the cursor
[into register x] (not |linewise|). Does the same as
"dl".
The <Del> key does not take a [count]. Instead, it
deletes the last character of the count.
See |:fixdel| if the <Del> key does not do what you
want. See |'whichwrap'| for deleting a line break
(join lines). {Vi does not support <Del>}
*X* *dh*
["x]X Delete [count] characters before the cursor [into
register x] (not |linewise|). Does the same as "dh".
Also see |'whichwrap'|.
*d*
["x]d{motion} Delete text that {motion} moves over [into register
x]. See below for exceptions.
*dd*
["x]dd Delete [count] lines [into register x] |linewise|.
*D*
["x]D Delete the characters under the cursor until the end
of the line and [count]-1 more lines [into register
x]; synonym for "d$".
(not |linewise|)
When the '#' flag is in 'cpoptions' the count is
ignored.
5.替换
["x]c{motion} Delete {motion} text [into register x] and start
insert. When 'cpoptions' includes the 'E' flag and
there is no text to delete (e.g., with "cTx" when the
cursor is just after an 'x'), an error occurs and
insert mode does not start (this is Vi compatible).
When 'cpoptions' does not include the 'E' flag, the
"c" command always starts insert mode, even if there
is no text to delete.
*cc*
["x]cc Delete [count] lines [into register x] and start
insert |linewise|. If 'autoindent' is on, preserve
the indent of the first line.
*C*
["x]C Delete from the cursor position to the end of the
line and [count]-1 more lines [into register x], and
start insert. Synonym for c$ (not |linewise|).
[count] + operator+[count]+motion
{motion} A command that moves the cursor. These are explained in
|motion.txt|. Examples:
w to start of next word
b to begin of current word
4j four lines down
/The<CR> to next occurrence of "The"
This is used after an |operator| command to move over the text
that is to be operated upon.
- If the motion includes a count and the operator also has a
count, the two counts are multiplied. For example: "2d3w"
deletes six words.
如果要彻底的了解完全用法,请vi -->:help