From 7fcb36f16dc85c91b82bee83d30754fc970574dc Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 14 Mar 2021 16:55:38 -0400 Subject: lotsa cool updates --- lua/lsp/init.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'lua/lsp/init.lua') diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua index e69de29b..b3d157ea 100644 --- a/lua/lsp/init.lua +++ b/lua/lsp/init.lua @@ -0,0 +1,36 @@ +--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.fn.sign_define("LspDiagnosticsVirtualTextError", {texthl = "LspDiagnosticsVirtualTextError", text = "", numhl = "LspDiagnosticsVirtualTextError"}) +vim.fn.sign_define("LspDiagnosticsVirtualTextWarning", {texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"}) +vim.fn.sign_define("LspDiagnosticsVirtualTextInformation", {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"}) +vim.fn.sign_define("LspDiagnosticsVirtualTextHint", {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"}) ]] + +--[[ vim.fn.sign_define("LspDiagnosticsSignError", {text = ""}) +vim.fn.sign_define("LspDiagnosticsSignWarning", {text = ""}) +vim.fn.sign_define("LspDiagnosticsSignInformation", {text = ""}) +vim.fn.sign_define("LspDiagnosticsSignHint", {text = ""}) ]] + +--[[ vim.fn.sign_define("LspDiagnosticsSignError", { text = " 🞮", numhl = "LspDiagnosticsDefaultError" }) +vim.fn.sign_define("LspDiagnosticsSignWarning", { text = " ▲", numhl = "LspDiagnosticsDefaultWarning" }) +vim.fn.sign_define("LspDiagnosticsSignInformation", { text = " ⁈", numhl = "LspDiagnosticsDefaultInformation" }) +vim.fn.sign_define("LspDiagnosticsSignHint", { text = " ⯁", numhl = "LspDiagnosticsDefaultHint" }) ]] + +vim.cmd('nnoremap gd lua vim.lsp.buf.definition()') +vim.cmd('nnoremap gD lua vim.lsp.buf.declaration()') +vim.cmd('nnoremap gr lua vim.lsp.buf.references()') +vim.cmd('nnoremap gi lua vim.lsp.buf.implementation()') +vim.cmd('nnoremap ca :Lspsaga code_action') +vim.cmd('nnoremap K :Lspsaga hover_doc') +vim.cmd('nnoremap lua vim.lsp.buf.signature_help()') +vim.cmd('nnoremap :Lspsaga diagnostic_jump_prev') +vim.cmd('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) ]] +-- Java +-- autocmd FileType java nnoremap ca lua require('jdtls').code_action() -- cgit v1.2.3