Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting emacs to turn things on at startup

Tags:

emacs

lisp

Whenever I start emacs, there are a few things I do right away:

M-x slime
M-x ido-mode

I also open a few files that I always use so they are available as buffers:

C-x C-f ....

When I get into a buffer, I then do this for that buffer (nearly all buffers):

M-x visual-line-mode

If it is a Lisp buffer, I also always do this as well:

M-x paredit-mode
M-x rainbow-delimiters-mode
M-x show-paren-mode

Is there a way for emacs to automatically do all of these things when I start emacs and when I load buffers?

like image 333
johnbakers Avatar asked Oct 30 '13 00:10

johnbakers


1 Answers

(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)
  ))
like image 192
lawlist Avatar answered Sep 30 '22 09:09

lawlist