考虑以下文本文件:
foo
bar
yoo
ploo
想象一下,我想在第三行搜索单词foo
和我的光标。我使用调用C-s
的{{1}},然后输入isearch-forward
并按foo
:问题是默认情况下,我的光标停留在同一位置,除非我按{{在按Enter
之前再次1}}。实际上,我希望C-s
移动到整个文件中,而不仅仅是光标之后的文件部分。我怎么能这样做?
答案 0 :(得分:2)
可能重复:
Automatically wrapping I-search?
试试这个:(从上面的链接复制)
(defadvice isearch-search (after isearch-no-fail activate)
(unless isearch-success
(ad-disable-advice 'isearch-search 'after 'isearch-no-fail)
(ad-activate 'isearch-search)
(isearch-repeat (if isearch-forward 'forward))
(ad-enable-advice 'isearch-search 'after 'isearch-no-fail)
(ad-activate 'isearch-search)))