在 vim 中,如何在终端显示的行中向下移动一行?
大家好,
我正在编辑一些源文件,其中包含大量文本和换行在我的终端中。如果我想在终端中看到它时向下移动一行,我不能按“j”,因为这将跳转到下一个回车符。所以我最终按住“w”直到到达我想要的位置。这对我来说似乎很愚蠢。
有人知道有什么方法可以实现我想要的吗?类似于“l80”的东西,只要我的终端显示 80 列,它就会给我我想要的东西,但一旦终端中的列数发生变化,它就不起作用。当它击中真正的界限时,它也不会跳过它们。
坦友
Possible Duplicate:
When navigating through word-wrapped text in VIM, how to make the selector move onto wrapped line sections?
Hi all,
I'm editing some source files with large chunks of text and lines that wrap in my terminal. If I want to move down one "line" as I see it in the terminal, I can't press 'j' as this will jump to the next carriage return. So I end up holding down 'w' until I'm where I want to be. This seems dumb to me.
Is there some way someone knows to achieve what I want? Something akin to 'l80' which would give me what I'm after so long as my terminal is displaying 80 columns, but wouldn't work as soon as the number of columns in the terminal changes. Nor would it jump the real lines when it hits them.
Thanyou
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 gj 和 gk 在换行内上下移动。
Use gj and gk to move up and down within a wrapped line.
很多人图:
为了让这个更方便。它没有任何不良影响。
(如果您不熟悉自定义 Vim,您可以将这两行放入
~/.vimrc
中,然后重新启动,它应该像您希望的那样运行。)A lot of people map:
To make this more convenient. It doesn't have any adverse effects.
(If you aren't familiar with customizing Vim, you can just put those two lines in
~/.vimrc
, and restart, and it should behave like you want it to.)