Hide all (not)matching lines in Vim

后端 未结 8 646
盖世英雄少女心
盖世英雄少女心 2021-01-30 01:35

Is it possible to show/hide all matching lines in vi or Vim? Not highlight but just show only those lines.

For example I have a text with word the word ERROR

8条回答
  •  隐瞒了意图╮
    2021-01-30 02:00

    Do you know about the :global command? Does this do what you want?

    :g/ERROR
    

    and for the opposite:

    :g!/Error
    

    or equivalently:

    :v/Error
    

提交回复
热议问题