简体   繁体   中英

How to make emacs remember my previous search & replace strings

I used to have this feature in the past (another Unix computer):

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.

(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.

Here a conf for savehist

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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