Add section on programming mode customizations

This commit is contained in:
Tom Willemse 2014-10-23 16:48:30 +02:00
parent 4baea6bdac
commit 039e445452
2 changed files with 27 additions and 15 deletions

View file

@ -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)

View file

@ -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