Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you use <TAB> to cycle through completion suggestions with ALE?

Tags:

neovim

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

like image 670
garrettmaring Avatar asked May 22 '18 17:05

garrettmaring


1 Answers

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.

like image 153
Marcus Buffett Avatar answered Sep 27 '22 20:09

Marcus Buffett