Some tweaks to lsp config

Now uses ccls instead of clang for c language server. Seems better at
jumping to definition.

Also adds <leader k> to open man page since shift k is now overwritten
with the popup for the declaration that lsp provides
master
Jonathan Hodgson 8 months ago
parent a1453227b9
commit daacb168c0
  1. 7
      nvim/.config/nvim/after/plugin/lsp.vim

@ -9,7 +9,7 @@ lua <<EOF
-- Bash Language Server
require'lspconfig'.bashls.setup{}
-- Clang Language Server
require'lspconfig'.clangd.setup{}
require'lspconfig'.ccls.setup{}
-- Go Language Server
require'lspconfig'.gopls.setup{}
-- Python Language Server
@ -20,10 +20,11 @@ lua <<EOF
require'lspconfig'.vuels.setup{}
EOF
function! s:ConfigureBuffer()
nnoremap <buffer> <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <buffer> <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
nnoremap <buffer> <silent> <Leader>ld <cmd>lua vim.diagnostic.open_float()<CR>
nnoremap <buffer> <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
nnoremap <buffer> <silent> gd <cmd>lua vim.lsp.buf.declaration()<CR>
nnoremap <buffer> <silent> <leader>k K
nnoremap <buffer> <silent> <c-]> <cmd>lua vim.lsp.buf.declaration()<CR>
endfunction
if has('autocmd')
augroup JHLanguageClientAutocmds

Loading…
Cancel
Save