每当我启动emacs时,我会立即做一些事情:
M-x slime
M-x ido-mode
我还打开了一些我一直使用的文件,因此它们可用作缓冲区:
C-x C-f ....
当我进入缓冲区时,我会为该缓冲区(几乎所有缓冲区)执行此操作:
M-x visual-line-mode
如果它是一个Lisp缓冲区,我也总是这样做:
M-x paredit-mode
M-x rainbow-delimiters-mode
M-x show-paren-mode
当我启动emacs和加载缓冲区时,emacs是否有办法自动执行所有这些操作?
答案 0 :(得分:5)
(add-hook 'emacs-startup-hook
(lambda ()
(kill-buffer "*scratch*")
(find-file "~/todo.org")
(ido-mode t)
))
;; Emacs Lisp
(add-hook 'emacs-lisp-mode-hook
(lambda ()
(slime-mode t)
(visual-line-mode 1)
(paredit-mode 1)
(rainbow-delimiters-mode 1)
(show-paren-mode 1)
))
;; Common Lisp
(add-hook 'lisp-mode-hook
(lambda ()
(slime-mode t)
(visual-line-mode 1)
(paredit-mode 1)
(rainbow-delimiters-mode 1)
(show-paren-mode 1)
))