-- 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 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') -- scroll down hover doc or scroll in definition preview vim.cmd( 'nnoremap lua require(\'lspsaga.action\').smart_scroll_with_saga(1)') -- scroll up hover doc vim.cmd( 'nnoremap lua require(\'lspsaga.action\').smart_scroll_with_saga(-1)') --[[ " 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()