mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
Enable auto-complete via TAB in most modes through a defadvice
This commit is contained in:
@@ -60,3 +60,10 @@
|
||||
(xterm-mouse-mode 1)
|
||||
(global-set-key [mouse-4] 'scroll-down-line)
|
||||
(global-set-key [mouse-5] 'scroll-up-line))
|
||||
|
||||
;; Auto-complete when indenting.
|
||||
(defadvice indent-for-tab-command (around ac-before-indent activate)
|
||||
"Call `auto-complete' if text was recently entered"
|
||||
(if (ac-trigger-command-p last-command)
|
||||
(auto-complete)
|
||||
ad-do-it))
|
||||
|
||||
@@ -71,6 +71,13 @@
|
||||
(ruby-indent-line t)
|
||||
(end-of-line))
|
||||
|
||||
;; Auto-complete when indenting
|
||||
(defadvice ruby-indent-command (around ac-before-ruby-indent activate)
|
||||
"Call `auto-complete' if text was recently entered"
|
||||
(if (ac-trigger-command-p last-command)
|
||||
(auto-complete)
|
||||
ad-do-it))
|
||||
|
||||
;; Yasnippet workaround for ruby-electric-mode
|
||||
;; See: http://code.google.com/p/yasnippet/issues/detail?id=71
|
||||
(defun yas/advise-indent-function (function-symbol)
|
||||
|
||||
Reference in New Issue
Block a user