Vim:在长线内快速移动 [英] Vim: move around quickly inside of long line
本文介绍了Vim:在长线内快速移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我启用了自动换行,并且往往有很长的行.但是在实际上是 4 行高的带有 "w" 的行内移动是很麻烦的.我一直使用/跳转到我要查找的单词,但这似乎有点过头了.
I have word-wrap enabled and tend to have quite long lines. But moving around inside a line that's actually 4 lines high with "w" is cumbersome. I keep using / to jump to the word I'm looking for, but that seems overdoing it a bit.
关于如何在一行内更快移动的任何提示?
Any hints on how to move more quickly inside of a line?
谢谢,
B先生
推荐答案
- 您可以使用
$
、0
和^
移动到行端点,然后使用w
和b
.另外,给w
和b
添加一个数字参数可以加速这个过程,所以使用6w
而不是w
可以带你去你需要去的地方. - 使用
f
和t
移动到单个字符也会有所帮助.(我通常将它与标点符号一起使用.例如,如果我在一个长行中有四个句子2f.
将转到第二个句子的末尾) - 使用
(
和)
键是导航整个句子的另一种方法. - 将长行拆分为多行(手动或使用
set tw=72
[或 80])可以使编辑更简单.您可以随时使用J
加入他们. - 我刚刚发现,您可以使用
gj
和gk
上下移动一行显示.这样,您就可以将一条环绕的行视为多行. - You can use
$
,0
, and^
to move to line endpoints and then usew
andb
. Also, adding a numeric argument tow
andb
can accelerate the process, so using6w
instead of justw
can put you about to where ou need to be. - Using
f
andt
to move to individual characters will help also. (I use this typically with punctuation. If, for example, I have four sentences on one long line2f.
will go to the end of the second sentence) - Using the
(
and)
keys are an alternative way to navigate entire sentences. - Splitting out long lines into multiple lines (manually, or with
set tw=72
[or 80]) can make editing them simpler. You can always join them later withJ
. - Something I just discovered, you can move up and down one displayed line by using
gj
andgk
. That way, you can treat your one wrapped line as multiple lines.
如果您对正在编辑的数据类型发表评论,这可能会让我们更容易提出建议.
If you comment on the type of data you're editing, it might make it easier for us to make suggestions.
这篇关于Vim:在长线内快速移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文