According to https://github.com/onivim/oni/wiki/Shortcuts#auto-completion, pressing
I'm currently using the following override in my init.vim:
inoremap <silent> <tab> <C-o>:call OniCommand('contextMenu.select')<CR>
However, this prevents me from using tab to insert an indent when there is no completion menu.
The default behavior should be fixed so that it aligns with what the wiki says and allows to use tab as both indent and completion depending on whether there's a completion menu visible. In fact, it would be better if during completion, it cycled through the options.
@dlee in order to complete with tab I have the following mapping in my config.tsx
oni.input.bind(["<enter>", "<tab>"], "contextMenu.select");
This works to allow both using tab to indent and to complete.
Re. tab to cycle though I agree, not sure what other people's feelings on this are but we can use this issue to track perhaps switching the default behaviour as I think @bryphe was looking to replicate vscodes behaviour but I personally much prefer vim's behaviour
As @Akin909 pointed out, most vim users will prefer to add tabs in the middle of an edit instead of opening the autocomplete menu. Since this is an easy enough snippet to put in your configuration I am closing this one.
For further reference a wiki page or configuration option can be provided if this seems like a big enough issue.
A year into the future, and this issue was driving me crazy.
As per @badosu solution, after referring to the Oni API, I added the following line into my Oni config.tsx:
oni.input.bind("<tab>", () => oni.snippets.insertSnippet(" "))
which worked but it didn't allow for successive insertions of TABs quickly. Unfortunately the sequence of keys to insert multiple TABs would be: (
I accidentally found another solution that worked for my needs. Hitting
Oh also, another alternative solution would have been to add a 200ms delay on the autocomplete dropdown menu, allowing for successive tabs to be inserted using the
Most helpful comment
@dlee in order to complete with tab I have the following mapping in my
config.tsxThis works to allow both using tab to indent and to complete.
Re. tab to cycle though I agree, not sure what other people's feelings on this are but we can use this issue to track perhaps switching the default behaviour as I think @bryphe was looking to replicate
vscodesbehaviour but I personally much prefer vim's behaviour