简体   繁体   English

在Emacs邪恶模式下搜索文本

[英]search text in Emacs evil mode

Cs works fine in searching text in Emacs evil mode, but if I want to use vim shortcuts for text searching, / works for the first matching in searching forward, but type / again does not go to the next matching position as in vim does. Cs在E​​macs邪恶模式下搜索文本时效果很好,但是如果我想使用vim快捷方式进行文本搜索,则/可以在向前搜索中使用第一个匹配项,但是再次输入/不会像在vim中那样转到下一个匹配位置。 So my question is, what is the shortcut to move to the next matching position if using vim shortcuts? 所以我的问题是,如果使用vim快捷方式,移动到下一个匹配位置的快捷方式是什么? Retype /[matching-text-pattern] surely works but too inconvenient. 重新键入/ [matching-text-pattern]当然可以,但是太不方便了。

Thanks! 谢谢!

Evil has two 'search modules': isearch , which is more similar to Emacs' search, and evil-search , which is more similar to Vim's search. Evil有两个“搜索模块”: isearch (与Emacs的搜索更相似)和evil-search (与Vim的搜索更相似)。 Switching to the evil-search module should give the behavior you want: 切换到evil-search模块应该会给出您想要的行为:

(evil-select-search-module 'evil-search-module 'evil-search)

This is how I do search in evil-mode: 这就是我在邪恶模式下进行搜索的方式:

/ [matching-text-pattern] / [matching-text-pattern]

RET RET

n for next match n下一场比赛

N for previous match N前一场比赛

Hope it helps :) 希望能帮助到你 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM