Vim:暂时只显示特定的行 [英] Vim: temporarily show only specific lines

查看:35
本文介绍了Vim:暂时只显示特定的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,在 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

推荐答案

类似于前面提到的窄插件,还有 NrrwRgn.视觉选择区域,:NR,窗口被分割,所选区域在新窗口中被隔离.确实对编码非常有用.

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.

这篇关于Vim:暂时只显示特定的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆