Add suggested configuration for always-insert-newline-on-enter behaviour (#231)

Co-authored-by: Jacques Heunis <git@jacquesheunis.com>
This commit is contained in:
Jacques Heunis
2020-10-17 17:44:39 +01:00
committed by GitHub
parent e82ab2e849
commit 7d33e19395

View File

@@ -17,7 +17,14 @@ Plug 'prabirshrestha/asyncomplete.vim'
```vim
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
```
If you prefer the enter key to always insert a new line (even if the popup menu is visible) then
you can amend the above mapping as follows:
```vim
inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() . "\<cr>" : "\<cr>"
```
### Force refresh completion