require("lspconfig") local sign = function(opts) vim.fn.sign_define(opts.name, { texthl = opts.name, text = opts.text, numhl = '' }) end sign({name = 'DiagnosticSignError', text = ''}) sign({name = 'DiagnosticSignWarn', text = ''}) sign({name = 'DiagnosticSignHint', text = ''}) sign({name = 'DiagnosticSignInfo', text = ''}) vim.diagnostic.config({ signs = true, virtual_text = false, update_in_insert = true, underline = false, severity_sort = true, float = { source = 'always', header = '', prefix = '', }, }) require("keybinds") map("n", "", "lua vim.lsp.buf.rename()") map("n", "", "lua vim.diagnostic.open_float()") --[[ nnoremap lua vim.lsp.buf.definition() nnoremap K lua vim.lsp.buf.hover() nnoremap gD lua vim.lsp.buf.implementation() nnoremap lua vim.lsp.buf.signature_help() nnoremap 1gD lua vim.lsp.buf.type_definition() nnoremap gr lua vim.lsp.buf.references() nnoremap g0 lua vim.lsp.buf.document_symbol() nnoremap gW lua vim.lsp.buf.workspace_symbol() nnoremap gd lua vim.lsp.buf.definition() -- Jump to the definition bufmap('n', 'gd', 'lua vim.lsp.buf.definition()') -- Jump to declaration bufmap('n', 'gD', 'lua vim.lsp.buf.declaration()') -- Lists all the implementations for the symbol under the cursor bufmap('n', 'gi', 'lua vim.lsp.buf.implementation()') -- Jumps to the definition of the type symbol bufmap('n', 'go', 'lua vim.lsp.buf.type_definition()') -- Lists all the references bufmap('n', 'gr', 'lua vim.lsp.buf.references()') -- Displays a function's signature information bufmap('n', '', 'lua vim.lsp.buf.signature_help()') -- Renames all references to the symbol under the cursor bufmap('n', '', 'lua vim.lsp.buf.rename()') -- Selects a code action available at the current cursor position bufmap('n', '', 'lua vim.lsp.buf.code_action()') bufmap('x', '', 'lua vim.lsp.buf.range_code_action()') -- Show diagnostics in a floating window bufmap('n', 'gl', 'lua vim.diagnostic.open_float()') -- Move to the previous diagnostic bufmap('n', '[d', 'lua vim.diagnostic.goto_prev()') -- Move to the next diagnostic bufmap('n', ']d', 'lua vim.diagnostic.goto_next()') ]]