Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (global-set-key (kbd "M-/") 'hippie-expand)
- ;; Allow tab to autocomplete
- (defun indent-or-expand (arg)
- "Either indent according to mode, or expand the word preceding point."
- (interactive "*P")
- (if (and
- (or (bobp) (= ?w (char-syntax (char-before))))
- (or (eobp) (not (= ?w (char-syntax (char-after))))))
- (dabbrev-expand arg)
- (tab-to-tab-stop)))
- (defun my-tab-fix ()
- (local-set-key [tab] 'indent-or-expand))
- (add-hook 'as-mode-hook 'my-tab-fix)
- (add-hook 'java-mode-hook 'my-tab-fix)
- (add-hook 'c-mode-hook 'my-tab-fix)
- (add-hook 'sh-mode-hook 'my-tab-fix)
- (add-hook 'emacs-lisp-mode-hook 'my-tab-fix)
Add Comment
Please, Sign In to add comment