summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/_lsp/init.lua
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-03-16 21:54:42 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-03-16 21:54:42 +0100
commit2b6ae8473e1b0fb8cc0bd16aa8c485a77ee5e847 (patch)
tree3e9e499480f1694f25a0835877e3ba5e63e403d4 /.config/nvim/lua/_lsp/init.lua
parentc0284168111a9b74761cf2094bdc16fec9006f7b (diff)
renaming, treesitter buggy
Diffstat (limited to '.config/nvim/lua/_lsp/init.lua')
-rw-r--r--.config/nvim/lua/_lsp/init.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/.config/nvim/lua/_lsp/init.lua b/.config/nvim/lua/_lsp/init.lua
new file mode 100644
index 0000000..4515e7c
--- /dev/null
+++ b/.config/nvim/lua/_lsp/init.lua
@@ -0,0 +1,19 @@
+--TODO figure out why this don't work
+vim.fn.sign_define("LspDiagnosticsSignError", {texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"})
+vim.fn.sign_define("LspDiagnosticsSignWarning", {texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"})
+vim.fn.sign_define("LspDiagnosticsSignInformation", {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"})
+vim.fn.sign_define("LspDiagnosticsSignHint", {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"})
+
+vim.cmd('nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>')
+vim.cmd('nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>')
+vim.cmd('nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>')
+vim.cmd('nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>')
+vim.cmd('nnoremap <silent> ca :Lspsaga code_action<CR>')
+vim.cmd('nnoremap <silent> K :Lspsaga hover_doc<CR>')
+-- vim.cmd('nnoremap <silent> <C-k> <cmd>lua vim.lsp.buf.signature_help()<CR>')
+vim.cmd('nnoremap <silent> <C-p> :Lspsaga diagnostic_jump_prev<CR>')
+vim.cmd('nnoremap <silent> <C-n> :Lspsaga diagnostic_jump_next<CR>')
+-- scroll down hover doc or scroll in definition preview
+vim.cmd('nnoremap <silent> <C-f> <cmd>lua require(\'lspsaga.action\').smart_scroll_with_saga(1)<CR>')
+-- scroll up hover doc
+vim.cmd('nnoremap <silent> <C-b> <cmd>lua require(\'lspsaga.action\').smart_scroll_with_saga(-1)<CR>')