简体   繁体   English

如何使emacs记住我以前的搜索并替换字符串

[英]How to make emacs remember my previous search & replace strings

I used to have this feature in the past (another Unix computer): 我过去曾经有此功能(另一台Unix计算机):

When I search & replace in Emacs (using "Esc %" keys), then when I do it next time, the search and replace strings are remembered from the previous time. 当我在Emacs中搜索和替换(使用“ Esc%”键)时,然后下次进行搜索时,会记住上一次的搜索和替换字符串。

(This was very handy, as if I need to search & replace for same strings in different files, I did not need to re-type the strings over and over for each file). (这非常方便,就好像我需要搜索并替换不同文件中的相同字符串一样,不需要为每个文件一遍又一遍地重新键入字符串)。

But now in my Emacs each time I do search & replace no previous strings appear: it is always an empty field. 但是现在每次执行搜索并替换我的Emacs时,都不会出现以前的字符串:它始终是一个空字段。

Here a conf for savehist 这是savehist的conf

(setq savehist-additional-variables    
        '(search-ring regexp-search-ring compile-history) 
        savehist-file "~/.emacs.d/savehist")
(savehist-mode t)  

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

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