diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-linting.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-linting.lua index a8ad4b7..bf007d8 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-linting.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-linting.lua @@ -6,7 +6,6 @@ return { lint.linters_by_ft = { javascript = { "eslint_d" }, - typescript = { "eslint_d" }, svelte = { "eslint_d" }, python = { "pylint" }, } diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-lspconfig.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-lspconfig.lua index 460c1f8..2226b13 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-lspconfig.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-lspconfig.lua @@ -8,9 +8,6 @@ return { { "folke/lazydev.nvim", opts = {} }, }, config = function() - -- import lspconfig plugin - local lspconfig = require("lspconfig") - -- import mason_lspconfig plugin local mason_lspconfig = require("mason-lspconfig") @@ -55,10 +52,14 @@ return { keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line opts.desc = "Go to previous diagnostic" - keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer + keymap.set("n", "[d", function() + vim.diagnostic.jump({ count = -1, float = true }) + end, opts) -- jump to previous diagnostic in buffer opts.desc = "Go to next diagnostic" - keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer + keymap.set("n", "]d", function() + vim.diagnostic.jump({ count = 1, float = true }) + end, opts) -- jump to next diagnostic in buffer opts.desc = "Show documentation for what is under cursor" keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor @@ -68,12 +69,18 @@ return { end, }) - -- Change the Diagnostic symbols in the sign column (gutter) - local signs = { Error = " ", Warn = " ", Hint = "󰠠 ", Info = " " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) - end + -- Diagnostic config + vim.diagnostic.config({ + signs = { + text = { + [vim.diagnostic.severity.ERROR] = "", + [vim.diagnostic.severity.WARN] = " ", + [vim.diagnostic.severity.HINT] = "󰠠", + [vim.diagnostic.severity.INFO] = " ", + }, + }, + virtual_text = true, + }) -- used to enable autocompletion (assign to every lsp server config) local capabilities = cmp_nvim_lsp.default_capabilities() diff --git a/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua b/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua index 7c53a3f..8bfdc3a 100644 --- a/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua +++ b/nvim/.config/nvim/lua/lazy-plugins/lsp-treesitter.lua @@ -1,50 +1,55 @@ return { - "nvim-treesitter/nvim-treesitter", - event = { - "BufReadPre", - "BufNewFile", - }, - build = ":TSUpdate", - dependencies = { - "windwp/nvim-ts-autotag", - }, - config = function() - local treesitter = require("nvim-treesitter.configs") + { + "nvim-treesitter/nvim-treesitter", + event = { + "BufReadPre", + "BufNewFile", + }, + build = ":TSUpdate", + dependencies = { + "windwp/nvim-ts-autotag", + }, + config = function() + local treesitter = require("nvim-treesitter.configs") - treesitter.setup({ - highlight = { - enable = true, - }, - indent = { - enable = true, - }, - autotag = { - enable = true, - }, - ensure_installed = { - "json", - "javascript", - "yaml", - "html", - "css", - "lua", - "vim", - "dockerfile", - "gitignore", - "markdown", - "bash", - "go", - "php", - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", + treesitter.setup({ + highlight = { + enable = true, }, - }, - }) - end, + indent = { + enable = true, + }, + autotag = { + enable = true, + }, + ensure_installed = { + "json", + "javascript", + "yaml", + "html", + "css", + "lua", + "vim", + "dockerfile", + "gitignore", + "markdown", + "bash", + "go", + "php", + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + node_incremental = "", + scope_incremental = false, + node_decremental = "", + }, + }, + }) + end, + }, + { + "nvim-treesitter/nvim-treesitter-context", + }, }