Skip to content

Instantly share code, notes, and snippets.

Created May 3, 2010

What would you like to do?
;; a modified version from
(defun smart-tab (completion-hook)
"This smart tab is minibuffer compliant: it acts as usual in
the minibuffer. Else, if mark is active, indents region. Else if
point is at the end of a symbol, expands it using the `completion-hook'.
Else indents the current line."
(if (string-match "Minibuf" (buffer-name))
(unless (minibuffer-complete)
(dabbrev-expand nil))
(if mark-active
(indent-region (region-beginning)
(if (looking-at "\\>")
(funcall completion-hook)
(add-hook 'clojure-mode-hook
(lambda ()
;; custom keybindings
(defun complete-clojure ()
(smart-tab 'slime-complete-symbol))
(local-set-key (kbd "<tab>") 'complete-clojure)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.