VIM: Search only between specific line numbers?

前端 未结 7 946
余生分开走
余生分开走 2020-12-13 09:06

I know that with Vim\'s substitution command you can specific a range of lines:

:12,24s/search/replace

I want to be able to specify a range

7条回答
  •  伪装坚强ぢ
    2020-12-13 09:23

    Using Narrow Region plugin we can open a temporary buffer with the range we need to search or change

    :900,1000NarrowRegion
    

    Then we can meke a search

    /thing
    

    Or a change and write the buffer back

    :%s/this/that/g
    :wq
    

提交回复
热议问题