Vim/Vi 中是否有命令将光标移动到搜索突出显示的末尾? [英] Is there a command in Vim/Vi to move the cursor to the end of a search highlight?

查看:23
本文介绍了Vim/Vi 中是否有命令将光标移动到搜索突出显示的末尾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Vim/Vi 中是否有任何命令可以在选定的搜索段内移动?

Are there any commands in Vim/Vi to move within a selected search segment?

例如,如果我搜索一个词,是否有任何命令可以将光标移动到突出显示部分的末尾?假设我有一个词FishTaco",我想搜索Fish"的所有实例并在其后插入一些内容.我知道我可以进行全局替换,但是如果我只想在几个非顺序实例中进行更改怎么办?

For instance, if I search for a word, are there any commands to motion the cursor to the end of the highlighted segment? Say I have a word, "FishTaco" and I want to search for all instances of "Fish" and insert something after it. I know I could do a global replace, but what if I want to only make the change in a couple non-sequential instances?

我可以看到可以方便地将光标移动到当前突出显示部分的末尾以执行操作.

I could see where it would be convenient to be able to motion the cursor to the end of the current highlighted segment to perform an action.

推荐答案

你可以这样做:

/Fish/e

末尾的 /e 将光标置于搜索区域的末尾(而不是默认的第一个字符.

The /e at the end lands your cursor at the end of the search region (instead of the first character by default.

这篇关于Vim/Vi 中是否有命令将光标移动到搜索突出显示的末尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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