VIM: Moves lsp config into after folder
This forces it to initialise everything after my colourscheme etc have been set resulting in error messages being read.
This commit is contained in:
parent
bae31d87cf
commit
8a05cf8689
1 changed files with 0 additions and 0 deletions
22
nvim/.config/nvim/after/plugin/lsp.vim
Normal file
22
nvim/.config/nvim/after/plugin/lsp.vim
Normal file
|
@ -0,0 +1,22 @@
|
|||
" Check that we are running inside nvim
|
||||
if !has('nvim')
|
||||
finish
|
||||
endif
|
||||
lua <<EOF
|
||||
-- Go Language Server
|
||||
require'nvim_lsp'.gopls.setup{}
|
||||
-- Vim Language Server
|
||||
require'nvim_lsp'.vimls.setup{}
|
||||
EOF
|
||||
function! s:ConfigureBuffer()
|
||||
nnoremap <buffer> <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>
|
||||
nnoremap <buffer> <silent> <Leader>ld <cmd>lua vim.lsp.util.show_line_diagnostics()<CR>
|
||||
nnoremap <buffer> <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
|
||||
nnoremap <buffer> <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR>
|
||||
endfunction
|
||||
if has('autocmd')
|
||||
augroup JHLanguageClientAutocmds
|
||||
autocmd!
|
||||
autocmd FileType go,vim call s:ConfigureBuffer()
|
||||
augroup END
|
||||
endif
|
Loading…
Add table
Add a link
Reference in a new issue