什么是我的.emacs中的自定义变量和面孔?

rab*_*ne9 20 emacs dot-emacs emacs-faces

这是我的.emacs我可以搞乱它吗?

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(better-fringes-bitmap ((t (:foreground "#00dd44"))))
 '(font-lock-string-face ((((class color) (min-colors 88) (background light)) (:foreground "#113355")))))
Run Code Online (Sandbox Code Playgroud)

到目前为止,我正在添加我想要的所有这些线...

san*_*inc 51

customizeNoufal指出,这些块是由界面添加的.但是,如果您愿意,可以将它们移动到单独的文件中.

只需将此添加到您的~/.emacs.d/init.el:

(setq custom-file "~/.emacs.d/custom.el")
(load custom-file)
Run Code Online (Sandbox Code Playgroud)

或者,如果您仍在使用旧式 ~/.emacs文件:

(setq custom-file "~/.custom.el")
(load custom-file)
Run Code Online (Sandbox Code Playgroud)

  • 看[这个问题](http://emacs.stackexchange.com/questions/1/are-there-any-advantages-to-using-emacs-d-init-el-instead-of-emacs)找出原因它被称为老式 (5认同)

Nou*_*him 12

这些是使用自定义系统时添加到文件中的行.它们是在您使用时生成的customize-*.默认情况下,自定义选项存储在.emacs文件中.您通常不会手动编辑这些.您必须使用customize-*命令来编辑它们.


Ado*_*obe 8

不要手动向这些行添加任何内容 - 您的更改将在某些事件上被emacs消失.而是使用以下customize-set-variable自定义面添加自定义变量set-face-attribute:

(customize-set-variable 'blink-cursor-mode nil)
(set-face-attribute 'default nil :family "DejaVu Sans Mono")
Run Code Online (Sandbox Code Playgroud)

为了定制某些包的面,有时需要首先请求包,然后设置它的面:

(require 'mumamo)
(set-face-attribute 'mumamo-background-chunk-major nil :background nil)
Run Code Online (Sandbox Code Playgroud)