nvim: Add workaround for completion-nvim bug
completion-nvim chaining seems to not allow multiple `triggered_only` definitions in the same linked chain of various completion options. In other words, when in pandoc files there is no possibility to have completion for lsp and buffer words by default and for paths on pressing `/`, as well as bib-citekeys on pressing `@`. Doing so requires automatically switching sources, which in turn is of little use when writing pandoc normally and it hangs every couple of seconds to recompile the bibtex list as soon as it runs out of buffer words to complete. Ideally, the completion-nvim bug should be looked at, but also the bibtex completion possibly completely turned into a lua parsed completer, so it does not depend on `vim-pandoc` and its (presumably) slower vimscript implementation.
This commit is contained in:
parent
5dde9db2e4
commit
cd52e47e22
3 changed files with 37 additions and 28 deletions
|
@ -7,7 +7,7 @@ imap <silent> <c-p> <Plug>(completion_smart_s_tab)
|
|||
" switch between completion sources manually with c-j/c-k
|
||||
" only do so if popupmenu is visible, otherwise normal function
|
||||
imap <silent> <c-j> <Plug>(completion_next_source)
|
||||
imap <silent> <c-k> <Plug>(completion_previous_source)
|
||||
imap <silent> <c-k> <Plug>(completion_prev_source)
|
||||
|
||||
" Set completeopt to have a better completion experience
|
||||
set completeopt=menuone,noinsert,noselect
|
||||
|
@ -47,15 +47,18 @@ endfun
|
|||
|
||||
" the completion chains for different filetypes
|
||||
" see https://github.com/nvim-lua/completion-nvim/wiki/chain-complete-support
|
||||
" BUG for triggered only bibcite completion, see: https://github.com/nvim-lua/completion-nvim/issues/158
|
||||
let g:completion_chain_complete_list = {
|
||||
\ 'pandoc': [
|
||||
\ { 'complete_items': ['buffer', 'lsp', 'snippet']},
|
||||
\ { 'complete_items': ['path'], 'triggered_only': ['/']},
|
||||
\ { 'complete_items': ['bibcite']},
|
||||
\ { 'mode': '<c-p>'},
|
||||
\ { 'mode': '<c-n>'}
|
||||
\],
|
||||
\ 'tex': [
|
||||
\ { 'complete_items': ['buffer', 'lsp', 'snippet']},
|
||||
\ { 'complete_items': ['path'], 'triggered_only': ['/']},
|
||||
\ { 'complete_items': ['bibcite'] },
|
||||
\ { 'mode': '<c-p>'},
|
||||
\ { 'mode': '<c-n>'}
|
||||
|
@ -63,6 +66,7 @@ let g:completion_chain_complete_list = {
|
|||
\ 'default': [
|
||||
\ { 'complete_items': [ 'lsp', 'snippet' ]},
|
||||
\ { 'complete_items': [ 'buffers' ] },
|
||||
\ { 'complete_items': [ 'path' ], 'triggered_only': ['/'] },
|
||||
\ { 'mode': '<c-p>'},
|
||||
\ { 'mode': '<c-n>'}
|
||||
\]
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
" enable python language servers
|
||||
lua require'nvim_lsp'.pyls.setup{}
|
||||
lua require'nvim_lsp'.vimls.setup{}
|
||||
lua require'nvim_lsp'.bashls.setup{}
|
||||
lua require'nvim_lsp'.gopls.setup{}
|
||||
lua require'nvim_lsp'.texlab.setup{}
|
||||
lua << END
|
||||
|
||||
" requires manual `:LspInstall sumneko_lua`
|
||||
lua require'nvim_lsp'.sumneko_lua.setup{}
|
||||
require'nvim_lsp'.pyls.setup{}
|
||||
require'nvim_lsp'.vimls.setup{}
|
||||
require'nvim_lsp'.bashls.setup{}
|
||||
require'nvim_lsp'.gopls.setup{}
|
||||
require'nvim_lsp'.texlab.setup{}
|
||||
|
||||
-- requires manual `:LspInstall sumneko_lua`
|
||||
require'nvim_lsp'.sumneko_lua.setup{}
|
||||
|
||||
END
|
||||
|
|
|
@ -67,3 +67,5 @@ glyphosate
|
|||
Monstanto
|
||||
univseralism
|
||||
universalisms
|
||||
CSO
|
||||
dialogue
|
||||
|
|
Loading…
Reference in a new issue