vim范围表示

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容