Vim: temporarily show only certain lines

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

It helps me focus on the issue.

I would like to do this without actually modifying the file. Any idea on how to do this?

greetings and greetings, Klaas

+6
source share
3 answers

Like the already mentioned narrow plugin, NrrwRgn . Visual selects the area ,: NR , and the window splits into the selected area selected in the new window. Very useful for coding, really.

+4
source
<ESC>:help folding 

Not really up to speed when folding, but I think you're looking for this feature.

+1
source

Try the narrow vim plugin:

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

VIM also has the ability to flush code, but this may not fully match what you want.

+1
source

Source: https://habr.com/ru/post/887934/


All Articles