3

In Visual Studio and Intellij I can press Tab to select the highlighted auto-completion.

In Helm: Is there a way to give Tab the same behavior as Return?

1
  • Why was this downvoted? I could not find any resource on this. Only "How do I use Tab for autocomplete" which was always answered with "you don't need Tab in Helm".
    – itmuckel
    Jun 10, 2016 at 8:07

2 Answers 2

5

You could add this to your init file:

(with-eval-after-load 'helm
  (define-key helm-map (kbd "TAB") #'helm-maybe-exit-minibuffer))

This should work in all cases except where a given helm source binds something different than helm-maybe-exit-minibuffer to RET, but off the top of my head I can't think of any sources that do.

Note that if you only want to apply this change for a specific source (rather than for all helm sources) you could see if that source has its own associated keymap, and bind it there instead.

2
  • Awesome, works fine! Thank you so much! But as a lisp noob: Why is there a hash in front of 'helm-maybe... ?
    – itmuckel
    Jun 9, 2016 at 20:45
  • 1
    It is completely optional. The #'foo is shorthand for (function foo) The docstring for function says: Like 'quote', but preferred for objects which are functions. In byte compilation, 'function' causes its argument to be compiled. 'quote' cannot do that.
    – nispio
    Jun 9, 2016 at 20:49
1

I just watched this video where they show this code to accomplish what you want.

(define-key helm-map (kbd "TAB") 'helm-execute-persistent-action)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.