From 039e4454525255a7b93a9fab4daf6e75e06f7b4f Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 23 Oct 2014 16:48:30 +0200 Subject: Add section on programming mode customizations --- emacs/.emacs.d/init.org | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'emacs/.emacs.d/init.org') 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 -- cgit v1.2.3-54-g00ecf