Skip to content

Instantly share code, notes, and snippets.

@uris77
Last active April 6, 2016 14:16
Show Gist options
  • Save uris77/288cf2dcf98fdcf441c6 to your computer and use it in GitHub Desktop.
Save uris77/288cf2dcf98fdcf441c6 to your computer and use it in GitHub Desktop.
Emacs Tips for Clojure
  • Move to previous function beginning-of-defun
  • Move to next function next-defun where :
(defun next-defun ()
  (interactive)
  (end-of-defun 2)
  (beginning-of-defun 1))
  • Repeat a character n times with C-u n <character>. For example, to insert ; 50 times:
C-u 50 ;

Functions for aligning text:

(defun bjm/align-whitespace (start end)
  "Align columns by whitespace"
  (interactive "r")
  (align-regexp start end
                "\\(\\s-*\\)\\s-" 1 0 t))

(defun bjm/align-& (start end)
  "Align columns by ampersand"
  (interactive "r")
  (align-regexp start end
                "\\(\\s-*\\)&" 1 1 t))

Increase Text Size: C-x C-+ Decrease Text Size: C-x C-- Reset Text Size: C-x C-0

Add indentation support for om.next:

(define-clojure-indent
  (defui '(1 :form (:defn))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment