diff options
| author | Robert Günzler <r@gnzler.io> | 2020-05-25 17:43:31 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2020-05-25 17:43:31 +0200 |
| commit | 4d467775057808e793df696ce2569f15927a5286 (patch) | |
| tree | 368275b831d01918c815949ee8ea5a6ec149c54a /.vim/after | |
| parent | f71a4833e4574b017c2f33a9b0eae1b4ef8e7b33 (diff) | |
vim: use nvim-lsp + completion-nvim instead of coc
Diffstat (limited to '.vim/after')
| -rw-r--r-- | .vim/after/plugin/coc.vim | 2 | ||||
| -rw-r--r-- | .vim/after/plugin/lsp.vim | 27 |
2 files changed, 17 insertions, 12 deletions
diff --git a/.vim/after/plugin/coc.vim b/.vim/after/plugin/coc.vim index 2ebe27a..c0e8f38 100644 --- a/.vim/after/plugin/coc.vim +++ b/.vim/after/plugin/coc.vim @@ -1,4 +1,6 @@ " coc json config -> ../../coc-settings.json +finish + if !exists('g:did_coc_loaded') finish endif diff --git a/.vim/after/plugin/lsp.vim b/.vim/after/plugin/lsp.vim index d31886a..ffdea10 100644 --- a/.vim/after/plugin/lsp.vim +++ b/.vim/after/plugin/lsp.vim @@ -1,18 +1,21 @@ -" if !has('nvim-0.5.0') -" echoerr 'nvim_lsp only works with neovim>=0.5.0' -" finish -" endif -finish +if !has('nvim-0.5.0') + " echoerr 'nvim_lsp only works with neovim>=0.5.0' + finish +endif -silent LspInstall bashls -silent LspInstall cssls +lua << EOF +local lsp = require 'nvim_lsp' +local util = require 'nvim_lsp/util' +local compl = require 'completion' -" call nvim_lsp#setup("gopls", {}) -call nvim_lsp#setup("pyls", {}) -call nvim_lsp#setup("rust_analyzer", {}) -call nvim_lsp#setup("texlab", {}) +lsp.gopls.setup{ + on_attach = compl.on_attach; + root_dir = util.root_pattern("go.mod"); +} +EOF -autocmd Filetype bash,shell,css,go,python,rust,tex,latex setl omnifunc=lsp#omnifunc +" autocmd Filetype bash,shell,css,go,python,rust,tex,latex setl omnifunc=lsp#omnifunc +" au Filetype lua setl omnifunc=v:lua.vim.lsp.omnifunc nnoremap <silent> gd :call lsp#text_document_definition()<CR> nnoremap <silent> gdc :call lsp#text_document_declaration()<CR> |