From 8577c3b7cba714551d3537f3337ee2490bd20106 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 14 Mar 2021 21:58:45 +0100 Subject: started moving to pure lua config --- .config/nvim/plug-config/lsp-config.vim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .config/nvim/plug-config/lsp-config.vim (limited to '.config/nvim/plug-config/lsp-config.vim') diff --git a/.config/nvim/plug-config/lsp-config.vim b/.config/nvim/plug-config/lsp-config.vim new file mode 100644 index 0000000..f9150a2 --- /dev/null +++ b/.config/nvim/plug-config/lsp-config.vim @@ -0,0 +1,19 @@ +" LSP config (the mappings used in the default file don't quite work right) +nnoremap gd lua vim.lsp.buf.definition() +nnoremap gD lua vim.lsp.buf.declaration() +nnoremap gr lua vim.lsp.buf.references() +nnoremap gi lua vim.lsp.buf.implementation() +nnoremap ca :Lspsaga code_action +" nnoremap K lua vim.lsp.buf.hover() +nnoremap K :Lspsaga hover_doc +nnoremap lua vim.lsp.buf.signature_help() +" nnoremap lua vim.lsp.diagnostic.goto_prev() +" nnoremap lua vim.lsp.diagnostic.goto_next() +nnoremap :Lspsaga diagnostic_jump_prev +nnoremap :Lspsaga diagnostic_jump_next + +" autoformat +autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100) +autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100) +autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 100) +" autocmd BufWritePre *.py lua vim.lsp.buf.formatting_sync(nil, 100) -- cgit v1.2.3-70-g09d2