bullets.vim
bullets.vim copied to clipboard
breaks completion if completeopt=noinsert
Minimal vimrc
cal plug#begin($XDG_DATA_HOME.'/nvim/plugins')
Plug 'dkarter/bullets.vim'
cal plug#end()
set completeopt=menu,noinsert
Steps to reproduce
- Start
nvim
- Start insertmode and type
/
-
<c-x><c-f>
should show a menu with suggested completions like/bin
and/etc
- Press
<cr>
to accept first suggestion
Actual behavior
A new line is created instead accepting the first suggestion. This only happens when bullets
is loaded.
Expected behavior
The first suggestion should be selected instead of creating a new line. This would also be vims default behavior with set completeopt=menu,noinsert
.
Notes
This is probably the reason for issue #74. You said there that you select the completion manually with <c-p>
and<c-n>
. Many people just accept the first suggestion with
I would suggest that bullets should not modify <cr>
if pumvisible
is true.
Thanks @astier, I'm happy to take PRs!
For anyone using coc: https://github.com/neoclide/coc.nvim/wiki/Completion-with-sources#use-cr-to-confirm-completion
You have to replace <cr>
with <Plug>(bullets-newline)
e.g.
let g:bullets_set_mappings = 0
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "<Plug>(bullets-newline)"