是否可以在 Vim/Neovim 中不为空行显示 ~? [英] Is it possible to not display a ~ for blank lines in Vim/Neovim?

查看:23
本文介绍了是否可以在 Vim/Neovim 中不为空行显示 ~?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Vim 中是否可以不为空行显示 ~?

Is it possible to not display a ~ for blank lines in Vim?

这会混淆 Mac Vim 的滚动条,而且我非常不喜欢这些波浪号.

This confuses Mac Vim's scrollbar, and I quite don't like these tildes.

推荐答案

正如 jamessan 所说,你不能禁用它们.滚动行为也不是 MacVim 特有的——它在终端和 gvim 中的工作方式相同:

As jamessan said, you can’t disable them. The scrolling behavior isn’t specific to MacVim, either — it works the same way in the terminal and in gvim:

与其将其视为问题,不如将其视为 Vim 灵活性的一部分.例如,您可以使用 zt 命令将当前行滚动到屏幕顶部,而不管它在文件中的哪个位置.这样可以更轻松地编写执行某些工作的宏,然后滚动回原来的位置.因此命令 变得更简单,'scrolloffset' 选项也是如此.

Instead of seeing this as a problem, what you should do is learn to see this as part of Vim’s flexibility. For example, you can use the zt command to scroll the current line to the top of the screen, regardless of where in the file it is. This can make it easier to write macros that do some work and then scroll back to where you were. The commands <C-E> and <C-Y> are made simpler because of this, as is the 'scrolloffset' option.

如果必须,重新训练您的大脑,将 Vim 的滚动条视为映射到哪一行在顶部,而不是哪一屏是可见的.

If you must, retrain your brain to think of Vim’s scrollbar as mapping to which line is on top, instead of which screenful is visible.

这篇关于是否可以在 Vim/Neovim 中不为空行显示 ~?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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