7

When using Ale, I'd like to use the Tab key to cycle through completion suggestions. By default, the arrow keys do it. What are the various configuration options for cycling through the suggestions as well as selecting the correct completion?

enter image description here

2
  • I have the same question - did you end up finding an answer?
    – vince
    Oct 2, 2018 at 13:14
  • 1
    An answer was just posted that works @vincecampanale! Oct 2, 2018 at 20:52

1 Answer 1

14

Could do something like this:

inoremap <silent><expr> <Tab>
      \ pumvisible() ? "\<C-n>" : "\<TAB>"

Essentially, when you hit tab in insert mode, check whether the popup is visible, and if it is then send Ctrl-n (to go to the next match), otherwise send a tab.

1
  • 6
    Thanks. I also added inoremap <silent><expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-TAB>" to make Shift-Tab select the previous suggestion.
    – Dan Keder
    Nov 11, 2018 at 11:36

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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