Nicer completion settings

This commit is contained in:
Leon Grünewald 2021-08-29 20:41:41 +02:00
parent bf729262cc
commit 2f69cd2ed6
2 changed files with 14 additions and 3 deletions

View file

@ -1,4 +1,6 @@
source ~/.vimrc source ~/.vimrc
lua << EOF lua << EOF
local nvim_lsp = require('lspconfig') local nvim_lsp = require('lspconfig')
local on_attach = require'completion'.on_attach local on_attach = require'completion'.on_attach
@ -6,10 +8,12 @@ local servers = { "html", "clangd", "vimls", "vuels", "phpactor", "rust_analyzer
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup { nvim_lsp[lsp].setup {
on_attach = on_attach, on_attach = require'completion'.on_attach,
flags = { flags = {
debounce_text_changes = 150, debounce_text_changes = 150,
} }
} }
end end
EOF EOF

11
.vimrc
View file

@ -40,9 +40,16 @@ let g:ctrlp_show_hidden = 1
"" Vim Closetag "" Vim Closetag
let g:closetag_filenames = '*.xml,*.xlf,*.html,*.xhtml,*.phtml' let g:closetag_filenames = '*.xml,*.xlf,*.html,*.xhtml,*.phtml'
"" completion-nvim
let g:completion_trigger_character = ['.', '::', '>']
let g:completion_trigger_keyword_length = 3
"" Vim Config "" Vim Config
" Some autocompletion settings. " Set completeopt to have a better completion experience
set completeopt+=longest,menuone,menu,preview set completeopt=menuone,noinsert,noselect
" Avoid showing message extra message when using completion
set shortmess+=c
" Add clipboard support " Add clipboard support
set clipboard=unnamedplus set clipboard=unnamedplus