Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun smart-tab () ;; implement a smarter TAB
- "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.
- Else indents the current line."
- (interactive)
- (if (minibufferp)
- (unless (minibuffer-complete)
- (auto-complete nil)) ;; use auto-complete
- ;; (hippie-expand nil)) ;; use hippie-expand
- ;; (dabbrev-expand nil)) ;; use dabbrev-expand
- (if mark-active
- (indent-region (region-beginning)
- (region-end))
- (if (looking-at "\\_>")
- (auto-complete nil) ;; use auto-complete
- ;; (hippie-expand nil)) ;; use hippie-expand
- ;; (dabbrev-expand nil) ;; use dabbrev-expand
- (indent-for-tab-command)))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement