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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
与已经提到的狭窄插件类似,有 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.
我自己不太了解折叠的速度,但我相信这就是您正在寻找的功能。
Not quite up to speed on folding myself, but I believe that's the feature you're looking for.
尝试 vim 窄插件:
http://www.vim.org/scripts/script .php?script_id=2097
VIM 还具有折叠代码的功能,但这可能无法完全满足您的需求。
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.