简体   繁体   English

如何使Emacs isearch更快?

[英]How can I make Emacs isearch faster?

I use isearch all the time in Emacs but I've noticed on large org mode files it can take some time to find the first match. 我一直在Emacs中使用isearch,但是我注意到在大型组织模式文件中,找到第一个匹配项可能需要一些时间。 Is there any way to speed up isearch in a buffer? 有什么方法可以加快缓冲区中的isearch速度吗?

EDIT: The most noticeable speed improvement came from setting isearch-lazy-highlight to nil . 编辑:最显着的速度改进来自将isearch-lazy-highlightnil I was experiencing a noticeable delay when calling isearch to jump to text and this delay has now disappeared. 呼叫isearch跳到文本时,我遇到了明显的延迟,现在这种延迟已经消失了。

One thing to keep in mind is that the longer your search pattern the quicker the search. 要记住的一件事是,搜索模式越长,搜索速度就越快。 So quickly typing a long search pattern (or even entering one by using Me ) can help if the buffer is humongous. 因此,如果缓冲区很大,快速键入一个长搜索模式(甚至使用Me输入一个搜索模式)将很有帮助。

Another thing you can do is to turn off option isearch-lazy-highlight , so you don't make Isearch find and highlight all of the matches in the currently visible text. 您可以做的另一件事是关闭选项isearch-lazy-highlight ,这样就不会使Isearch查找并突出显示当前可见文本中的所有匹配项。 See also options lazy-highlight-initial-delay and lazy-highlight-interval . 另请参阅选项lazy-highlight-initial-delaylazy-highlight-interval

More generally, consult the Isearch doc. 一般而言,请查阅Isearch文档。

If you were to Narrow the buffer to only the section(s) of interest before searching, then the search would be faster. 如果要在搜索之前将缓冲区仅缩小到感兴趣的部分,则搜索会更快。

Whether this represents an overall time-saving or time-loss no doubt depends upon your use-cases. 这是节省时间还是减少时间,无疑取决于您的用例。

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

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