Vim: temporarily show only specific lines

后端 未结 3 1778
你的背包
你的背包 2021-01-12 15:26

Sometimes, in Vim, I want to show only a specific part of a file (for example, a specific method) while hiding the rest.

This helps me to focus at the problem at han

相关标签:
3条回答
  • 2021-01-12 15:57

    Similar to the already mentioned narrow plug-in, there's NrrwRgn. Visual select the region, :NR and the window is split with the selected region isolated in the new window. Very useful for coding, indeed.

    0 讨论(0)
  • 2021-01-12 16:12

    Try the vim narrow plugin:

    http://www.vim.org/scripts/script.php?script_id=2097

    VIM also has the ability to fold code, but that may not map entirely to what you want.

    0 讨论(0)
  • 2021-01-12 16:13
    <ESC>:help folding
    

    Not quite up to speed on folding myself, but I believe that's the feature you're looking for.

    0 讨论(0)
提交回复
热议问题