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 3 years ago
parent a6cb84e420
commit 4f8f58d992
  1. 7
      nvim/.config/nvim/after/plugin/lsp.vim

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

Loading…
Cancel
Save