简体   繁体   中英

How can I save my Emacs settings?

I am using the Emacs editor, and every time I start Emacs, I lose my previous settings.

For example, every time I have to type:

  • Mx cua-mode RET
  • Mx auto-complete-mode RET

How can I save my settings in Emacs?

Thanks.

You can add them to your .emacs file.

(cua-mode)
(auto-complete-mode)

If you find that there are already things in your .emacs file, then you might want to add the commands at the end.

The best answer I can think of is to point you at the manual:
http://www.gnu.org/software/emacs/manual/html_node/emacs/Customization.html

In particular, see the sections on "Easy Customization" and the "Init File"; but I would recommend at least skimming over everything in this section.

In your emacs directory there is a site-lisp folder. Normally it will be empty. you could create a file default.el in this folder. Add these two lines (cua-mode t) (auto-complete-mode) and save it.This will be executed during Init. If you want to set environment variables for your emacs application only(not permanent) add a file called site-start.el in the site-lisp directory and define value for that variable ex:(setenv "VARIABLENAME" "value"). The site-lisp directory is in the standard search path for Lisp library.

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