From 158da0df92ffaeeb3e832eab86fdd40a8f609e74 Mon Sep 17 00:00:00 2001 From: Luca Matei Pintilie Date: Sun, 15 Sep 2024 22:43:40 +0200 Subject: nvim: update deps and format --- .config/nvim/lua/keybinds.lua | 54 ++++++++++++++++++++++--------------------- .config/nvim/lua/lsp.lua | 2 +- .config/nvim/lua/plugins.lua | 8 +++++++ 3 files changed, 37 insertions(+), 27 deletions(-) (limited to '.config/nvim') diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua index 6094a61..3b7a1ca 100644 --- a/.config/nvim/lua/keybinds.lua +++ b/.config/nvim/lua/keybinds.lua @@ -4,6 +4,7 @@ local ufo = require("ufo") local nt_api = require("nvim-tree.api") local spider = require("spider") local toggle_plain = require("utils").toggle_plain; +local trouble = require("trouble") vim.g.mapleader = " " @@ -37,7 +38,8 @@ vim.keymap.set("n", "U", vim.cmd.UndotreeToggle) vim.keymap.set("n", "m", ":MinimapToggle") vim.keymap.set("n", "b", ":Gitsigns blame_line") vim.keymap.set("n", "h", ":Gitsigns preview_hunk") -vim.keymap.set("n", ",", ":TroubleToggle") +vim.keymap.set("n", ",", function() trouble.toggle("diagnostics") end) +-- ":Trouble diagnostics toggle focus=false filter.buf=0") vim.keymap.set("n", "t", ":belowright split | resize 5 | terminal") vim.keymap.set("n", "[", ufo.openAllFolds) @@ -65,29 +67,29 @@ vim.keymap.set({ "t" }, "", "") vim.opt.whichwrap = "<,>,h,l,[,]" wk.add({ - { ",", desc = "Show errors" }, - { "", desc = "Quick Action" }, - { "", desc = "Show buffers" }, - { "D", desc = "Definition" }, - { "F", desc = "Format" }, - { "J", desc = "Signature help" }, - { "K", desc = "Hover" }, - { "L", desc = "Toggle plain mode" }, - { "N", desc = "Next tab" }, - { "P", desc = "Previous tab" }, - { "R", desc = "Show References" }, - { "S", desc = "Symbols" }, - { "U", desc = "Undo tree" }, - { "[", desc = "Open folds" }, - { "]", desc = "Close folds" }, - { "b", desc = "Blame line" }, - { "d", desc = "Show diagnostics" }, - { "f", desc = "Find files" }, - { "h", desc = "Preview hunk" }, - { "m", desc = "Toggle Minimap" }, - { "n", desc = "Show file tree" }, - { "q", desc = "Quit" }, - { "r", desc = "Rename" }, - { "s", desc = "Save file" }, - { "t", desc = "Open terminal" }, + { ","; desc = "Show errors" }; + { ""; desc = "Quick Action" }; + { ""; desc = "Show buffers" }; + { "D"; desc = "Definition" }; + { "F"; desc = "Format" }; + { "J"; desc = "Signature help" }; + { "K"; desc = "Hover" }; + { "L"; desc = "Toggle plain mode" }; + { "N"; desc = "Next tab" }; + { "P"; desc = "Previous tab" }; + { "R"; desc = "Show References" }; + { "S"; desc = "Symbols" }; + { "U"; desc = "Undo tree" }; + { "["; desc = "Open folds" }; + { "]"; desc = "Close folds" }; + { "b"; desc = "Blame line" }; + { "d"; desc = "Show diagnostics" }; + { "f"; desc = "Find files" }; + { "h"; desc = "Preview hunk" }; + { "m"; desc = "Toggle Minimap" }; + { "n"; desc = "Show file tree" }; + { "q"; desc = "Quit" }; + { "r"; desc = "Rename" }; + { "s"; desc = "Save file" }; + { "t"; desc = "Open terminal" }; }, { prefix = "" }); diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index d43a931..4d7a28e 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -115,7 +115,7 @@ vim.api.nvim_create_autocmd("LspAttach", { local lsputils = lspconfig.util -lspconfig.tsserver.setup({ +lspconfig.ts_ls.setup({ on_attach = function(client, bufnr) client.server_capabilities.documentFormattingProvider = false on_attach(client, bufnr) diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 11b0b3d..1b502eb 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -114,6 +114,7 @@ local function init_plugins() local telescopeConfig = require("telescope.config") local previewers = require("telescope.previewers") local lsp_lens = require("lsp-lens") + local trouble = require("trouble") local _bad = { ".*%.cshtml" } local bad_files = function(filepath) @@ -439,6 +440,13 @@ local function init_plugins() SymbolKind.Interface; }; }) + + trouble.setup({ + use_lsp_diagnostic_signs = true; + indent_lines = true; + warn_no_results = false; + open_no_results = true; + }) end local function clone_paq() -- cgit v1.2.3