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

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

推荐阅读更多精彩内容

  • 官网 中文版本 好的网站 Content-type: text/htmlBASH Section: User ...
    不排版阅读 9,947评论 0 5
  • ORA-00001: 违反唯一约束条件 (.) 错误说明:当在唯一索引所对应的列上键入重复值时,会触发此异常。 O...
    我想起个好名字阅读 10,792评论 0 9
  • 一、Python简介和环境搭建以及pip的安装 4课时实验课主要内容 【Python简介】: Python 是一个...
    _小老虎_阅读 11,132评论 0 10
  • 文/白茶与情歌 我朝你走了99步,就差最后一步,我一直在想为什么你不回头朝我走一步,现在我想也许是我没用勇气走完最...
    风定落花深阅读 3,532评论 1 0
  • 陈奕迅:躁郁症 陈奕迅曾在演唱会中自曝患躁郁症及“人群恐惧症”,令粉丝担心不已。陈奕迅也多次在受访时坦承近年压力大...
    问暖健康阅读 3,025评论 0 0