diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 903d27c..021ad63 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -2,11 +2,11 @@ local on_attach = function(client, bufnr) -- Mappings. -- See `:help vim.lsp.*` for documentation on any of the below functions local bufopts = { noremap = true, silent = true, buffer = bufnr } - vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts) - vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts) + vim.keymap.set("n", "gd", "TroubleToggle lsp_definitions") + vim.keymap.set("n", "gr", "TroubleToggle lsp_references") vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts) vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) - vim.keymap.set("n", "D", vim.lsp.buf.type_definition, bufopts) + vim.keymap.set("n", "D", "TroubleToggle lsp_type_definitions") vim.keymap.set("n", "rn", vim.lsp.buf.rename, bufopts) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, bufopts) vim.keymap.set( @@ -89,6 +89,6 @@ return { "neovim/nvim-lspconfig", cond = not vim.g.vscode, event = { "BufReadPre", "BufNewFile" }, - dependencies = { "cmp-nvim-lsp", "folke/neodev.nvim", "jose-elias-alvarez/null-ls.nvim" }, + dependencies = { "cmp-nvim-lsp", "folke/trouble.nvim", "folke/neodev.nvim", "jose-elias-alvarez/null-ls.nvim" }, config = config, } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 216374f..5be93bb 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -4,23 +4,32 @@ return { dependencies = { "nvim-tree/nvim-web-devicons", "folke/noice.nvim", "folke/tokyonight.nvim" }, event = { "BufReadPre", "BufNewFile" }, config = true, - opts = { - options = { - theme = "tokyonight", - component_separators = "|", - section_separators = { left = "", right = "" }, - globalstatus = true, - }, - sections = { - lualine_a = { { "mode", separator = { left = "" }, right_padding = 2 } }, - lualine_b = { "filename", { "branch", icon = "󰊢" }, "diff" }, - lualine_c = { "diagnostics" }, - lualine_x = { "filetype", "fileformat", "encoding" }, - lualine_y = { "progress" }, - lualine_z = { "selectioncount", { "location", separator = { right = "" }, left_padding = 2 } }, - }, - tabline = {}, - winbar = {}, - extensions = { "aerial", "fzf", "lazy", "neo-tree", "toggleterm", "trouble" }, - }, + opts = function() + return { + options = { + theme = "tokyonight", + component_separators = "|", + section_separators = { left = "", right = "" }, + globalstatus = true, + }, + sections = { + lualine_a = { { "mode", separator = { left = "" }, right_padding = 2 } }, + lualine_b = { "filename", { "branch", icon = "󰊢" }, "diff" }, + lualine_c = { + "diagnostics", + { + require("noice").api.status.mode.get, + cond = require("noice").api.status.mode.has, + color = { fg = "#ff9e64" }, + }, + }, + lualine_x = { "filetype", "fileformat", "encoding" }, + lualine_y = { "progress" }, + lualine_z = { "selectioncount", { "location", separator = { right = "" }, left_padding = 2 } }, + }, + tabline = {}, + winbar = {}, + extensions = { "aerial", "fzf", "lazy", "neo-tree", "toggleterm", "trouble" }, + } + end, } diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua index 335d29c..72cf68d 100644 --- a/lua/plugins/noice.lua +++ b/lua/plugins/noice.lua @@ -5,20 +5,18 @@ return { dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify", + "stevearc/dressing.nvim", }, config = true, opts = { + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + inc_rename = false, + lsp_doc_border = true, + }, lsp = { - progress = { - enabled = true, - format = { - "({data.progress.percentage}%) ", - -- { "{spinner} ", hl_group = "NoiceLspProgressSpinner" }, - { "{data.progress.title} ", hl_group = "NoiceLspProgressTitle" }, - { "{data.progress.client} ", hl_group = "NoiceLspProgressClient" }, - }, - }, - -- override markdown rendering so that **cmp** and other plugins use **Treesitter** override = { ["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.stylize_markdown"] = true, @@ -32,13 +30,5 @@ return { win_options = { winblend = 0 }, }, }, - -- you can enable a preset for easier configuration - presets = { - bottom_search = false, -- use a classic bottom cmdline for search - command_palette = true, -- position the cmdline and popupmenu together - long_message_to_split = false, -- long messages will be sent to a splitnoice - inc_rename = true, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = true, -- add a border to hover docs and signature help - }, }, } diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua index d0a41f8..74e2f9c 100644 --- a/lua/plugins/notify.lua +++ b/lua/plugins/notify.lua @@ -6,6 +6,6 @@ return { opts = { background_colour = "#000000", fps = 60, - render = "default", -- "minimal", "simple" + render = "compact", }, } diff --git a/lua/plugins/nvim_cmp.lua b/lua/plugins/nvim_cmp.lua index 6d63aa6..4d1106d 100644 --- a/lua/plugins/nvim_cmp.lua +++ b/lua/plugins/nvim_cmp.lua @@ -41,11 +41,6 @@ local config = function() -- Set configuration for specific filetype. cmp.setup.filetype("norg", { sources = { { name = "neorg" } } }) - cmp.setup.cmdline({ "/", "?" }, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = "buffer" } } }) - cmp.setup.cmdline( - ":", - { mapping = cmp.mapping.preset.cmdline(), sources = { { name = "path" }, { name = "cmdline" } } } - ) cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) end @@ -56,9 +51,6 @@ return { event = { "InsertEnter", "CmdlineEnter" }, dependencies = { "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", "windwp/nvim-autopairs", "saadparwaiz1/cmp_luasnip", "L3MON4D3/LuaSnip", diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index b9fe241..b8ec9d8 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -3,19 +3,12 @@ return { cond = not vim.g.vscode, dependencies = "nvim-tree/nvim-web-devicons", cmd = "TroubleToggle", - init = function() - vim.keymap.set("n", "xx", "TroubleToggle") - vim.keymap.set("n", "xw", "TroubleToggle workspace_diagnostics") - vim.keymap.set("n", "xd", "TroubleToggle document_diagnostics") - vim.keymap.set("n", "xq", "TroubleToggle quickfix") - vim.keymap.set("n", "xl", "TroubleToggle loclist") - vim.keymap.set("n", "gR", "TroubleToggle lsp_references") - end, + init = function() vim.keymap.set("n", "xx", "TroubleToggle") end, config = true, opts = { mode = "workspace_diagnostics", auto_open = false, - auto_close = false, + auto_close = true, auto_preview = true, auto_jump = { "lsp_definitions" }, use_diagnostic_signs = true,