在(neo)vim中,我如何跳转到文本对象的开头或结尾?

huangapple go评论56阅读模式
英文:

In (neo)vim, how can I jump to the start or end of a text object?

问题

我熟悉如何在各种文本对象内部或周围进行更改、删除、复制等操作。我想要跳转到当前句子的开头或结尾,或者我当前所在的任何其他文本对象。有没有相应的命令可以实现这个功能?

英文:

I am familiar with how I can change, delete, yank etc inside or around various text objects.

I would like to jump to the start or end of the current sentence, or any other text object I currently in.

Is there some command to do this?

答案1

得分: 1

没有通用的命令来完成这个操作。

也就是说,使用v<text-object><Esc>会将光标留在文本对象的末尾,而使用v<text-object>o<Esc>会将光标留在开头。vip<Esc>vipo<Esc>也不错。

请参考:help v_o

如果你感到有冒险精神,可以考虑使用这个基本技巧来构建自己的自定义动作。

英文:

There is no generic command for that.

That said, doing v<text-object><Esc> leaves the cursor at the end of the text object, and doing v<text-object>o<Esc> leaves the cursor at the start. vip<Esc> or vipo<Esc> are not so bad.

See :help v_o.

If you feel adventurous, you may consider using that base technique to build your own custom motions.

huangapple
  • 本文由 发表于 2023年2月8日 18:56:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75384766.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定