Old vim config, new is found in main dotfiles
https://git.jonathanh.co.uk/jab2870/Dotfiles/src/branch/master/nvim/.config/nvim
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
675 B
27 lines
675 B
4 years ago
|
" 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
|
||
|
|