diff --git a/emacs/init.org b/emacs/init.org index a41452b..0a72b5c 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -524,6 +524,22 @@ them immediately, they take a little time to load. (eval-after-load "org" '(require 'org-init)) #+END_SRC +Found on [[http://emacsredux.com/blog/2013/03/28/indent-defun/][Indent defun - Emacs Redux]], indents a function. Should be +just a tiny bit easier than going to the beginning of a function and +then calling =indent-sexp=, which only works in lisp-like languages +anyway. + +#+BEGIN_SRC emacs-lisp + (defun indent-defun () + "Indent the current defun." + (interactive) + (save-excursion + (mark-defun) + (indent-region (region-beginning) (region-end)))) + + (global-set-key (kbd "C-M-z") 'indent-defun) +#+END_SRC + #+BEGIN_SRC emacs-lisp (eval-after-load "rainbow-mode" '(oni:rainbow-mode-init)) (eval-after-load "smex" '(oni:smex-init))