Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: temporarily show only specific lines

Tags:

vim

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 hand.

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

cheers & regards, Klaas

like image 379
Klaas van Schelven Avatar asked May 12 '11 14:05

Klaas van Schelven


1 Answers

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.

like image 59
Walter Avatar answered Sep 28 '22 05:09

Walter