range | 描述 |
---|---|
1,$ | 行首到行尾 |
.,$ | 当前行到行尾 |
% | 整个文件 |
- %不表示range的时候,代表当前文件名
Line numbers may be specified with(来自官方文档cmdline.txt):
{number} an absolute line number
. the current line :.
$ the last line in the file :$
% equal to 1,$ (the entire file) :%
't position of mark t (lowercase) :'
'T position of mark T (uppercase); when the mark is in
another file it cannot be used in a range
/{pattern}[/] the next line where {pattern} matches :/
?{pattern}[?] the previous line where {pattern} matches :?
\/ the next line where the previously used search
pattern matches
\? the previous line where the previously used search
pattern matches
\& the next line where the previously used substitute
pattern matches
参考
:help range