From 039e4454525255a7b93a9fab4daf6e75e06f7b4f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 23 Oct 2014 16:48:30 +0200 Subject: [PATCH] Add section on programming mode customizations --- emacs/.emacs.d/init.el | 1 - emacs/.emacs.d/init.org | 41 +++++++++++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index a62a5f5..879a317 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -1253,7 +1253,6 @@ from myaethon2.core.decorators import ( (add-hook 'diary-display-hook 'oni:diary-display-func) (add-hook 'enh-ruby-mode #'oni:electric-pair-local-mode) (add-hook 'git-commit-mode-hook #'oni:set-ispell-local-en-dict) -(add-hook 'haml-mode #'oni:electric-pair-local-mode) (add-hook 'haskell-mode-hook 'oni:haskell-mode-func) (add-hook 'java-mode-hook #'oni:electric-pair-local-mode) (add-hook 'js-mode-hook #'moz-minor-mode) diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 8075ddc..7cf8144 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -975,16 +975,7 @@ (local-unset-key (kbd "RET"))))) #+END_SRC -* Automatically indent some modes - - Some modes, not all, benefit from using =electric-indent-mode=. So - enable it locally for those modes. - - #+BEGIN_SRC emacs-lisp - (add-hook 'scss-mode-hook #'electric-indent-local-mode) - #+END_SRC - -* Automatically pair in some modes +* Local minor mode for =electric-pair-mode= Almost all modes benefit from automatic delimiter pairing, but not all modes are equal. =paredit= works awesomely for anything lisp-like, @@ -1008,11 +999,33 @@ ))) #+END_SRC - And then we just enable it for the interesting modes. +* Programming - #+BEGIN_SRC emacs-lisp - (add-hook 'scss-mode-hook #'oni:electric-pair-local-mode) - #+END_SRC + Emacs is a real programmer's editor, especially so because it's so + programmable itself. It also offers modes for a lot of programming + languages and 3rd-party packages offer even more. + +* SCSS + + - Automatically match parentheses and other delimiters. + + #+BEGIN_SRC emacs-lisp + (add-hook 'scss-mode-hook #'oni:electric-pair-local-mode) + #+END_SRC + + - Automatically indent code. + + #+BEGIN_SRC emacs-lisp + (add-hook 'scss-mode-hook #'electric-indent-local-mode) + #+END_SRC + +* Haml + + - Automatically match parentheses and other delimiters. + + #+BEGIN_SRC emacs-lisp + (add-hook 'haml-mode-hook #'oni:electric-pair-local-mode) + #+END_SRC * Load custom file