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 letters e.g. “del” which get immediately auto-completed inline to “delete”. If I wanted to type “delete” I hit TAB and this is alright. But what if I wanted to actually type “del” and a newline – here hitting RET again auto-completes to “delete”.
How can I force RET to be newline if only inline suggestion is shown? Once the auto-complete menu is displayed I want it to be the trigger key again as usual.
Thank you!
By adding the following lines after other settings for the
auto-completemode, you can enable completion by RET only when completion menu is displayed:ac-completing-mapis a keymap where RET is by default bound toac-complete, andac-menu-mapis a keymap for completion on completion menu. Theac-menu-mapkeymap is enabled when theac-use-menu-mapvariable ist.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-completeby default.