I am very happy with auto-complete but one thing bugs me:
I\'m setup to show the inline suggestion immediately but the menu with 0.9 s delay. I type the first few lette
By adding the following lines after other settings for the auto-complete
mode, you can enable completion by RET only when completion menu is displayed:
(define-key ac-completing-map "\C-m" nil)
(setq ac-use-menu-map t)
(define-key ac-menu-map "\C-m" 'ac-complete)
ac-completing-map
is a keymap where RET is by default bound to ac-complete
, and ac-menu-map
is a keymap for completion on completion menu. The ac-menu-map
keymap is enabled when the ac-use-menu-map
variable is t
.
FYI, completion can be stopped by pressing C-g at any time. So you will also be able to hit C-g and RET to enter a newline with the bindings of RET intact. Also, you can use C-j rather than RET when you want to enter a newline. C-j does not bind to ac-complete
by default.