From eb3588923f6362dc1b12e4b6b73321a6545a73ba Mon Sep 17 00:00:00 2001 From: ChrisHilborne Date: Tue, 13 Feb 2024 23:12:50 +0100 Subject: [PATCH] Trouble, Debug Go, Noice --- lua/custom/configs/remaps.lua | 17 ++++++++++------- lua/custom/plugins/debug.lua | 13 +++++++++++++ lua/custom/plugins/neodev.lua | 9 +++++++++ lua/custom/plugins/noice.lua | 35 ++++++++++++++++++++++++++++++++++ lua/custom/plugins/trouble.lua | 14 +++++++------- 5 files changed, 74 insertions(+), 14 deletions(-) create mode 100644 lua/custom/plugins/neodev.lua create mode 100644 lua/custom/plugins/noice.lua diff --git a/lua/custom/configs/remaps.lua b/lua/custom/configs/remaps.lua index 10294675..3712c4b4 100755 --- a/lua/custom/configs/remaps.lua +++ b/lua/custom/configs/remaps.lua @@ -16,7 +16,7 @@ vim.keymap.set("n", "N", "Nzzzv") -- greatest remap ever -- paste without adding deleted text to register vim.keymap.set("x", "p", [["_dP]]) --- delete without adding deleted text to register +-- delete without adding deleted text to register vim.keymap.set("x", "d", [["_d]]) -- next greatest remap ever : asbjornHaland @@ -40,9 +40,12 @@ vim.keymap.set("n", "s", [[:%s/\<\>//gI< vim.keymap.set("n", "+", "!chmod +x %", { silent = true }) --trouble.nvim -vim.keymap.set("n", "xx", function() require("trouble").toggle() end) -vim.keymap.set("n", "xw", function() require("trouble").toggle("workspace_diagnostics") end) -vim.keymap.set("n", "xd", function() require("trouble").toggle("document_diagnostics") end) -vim.keymap.set("n", "xq", function() require("trouble").toggle("quickfix") end) -vim.keymap.set("n", "xl", function() require("trouble").toggle("loclist") end) -vim.keymap.set("n", "gR", function() require("trouble").toggle("lsp_references") end) +vim.keymap.set("n", "xx", function() require("trouble").toggle() end, { desc = 'Open Trouble' }) +vim.keymap.set("n", "xw", function() require("trouble").toggle("workspace_diagnostics") end, + { desc = 'Trouble [w]orkspace Diagnostics' }) +vim.keymap.set("n", "xd", function() require("trouble").toggle("document_diagnostics") end, + { desc = 'Trouble [d]ocument Diagnostics' }) +vim.keymap.set("n", "xq", function() require("trouble").toggle("quickfix") end, { desc = 'Trouble [q]uickfix' }) +vim.keymap.set("n", "xl", function() require("trouble").toggle("loclist") end, { desc = 'Trouble [l]oclist' }) +vim.keymap.set("n", "xR", function() require("trouble").toggle("lsp_references") end, + { desc = 'Trouble [g]o to [R]eferences' }) diff --git a/lua/custom/plugins/debug.lua b/lua/custom/plugins/debug.lua index 36af2164..4ba264c4 100755 --- a/lua/custom/plugins/debug.lua +++ b/lua/custom/plugins/debug.lua @@ -25,6 +25,19 @@ return { local dap = require 'dap' local dapui = require 'dapui' + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() + end + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() + end + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() + end + + vim.fn.sign_define('DapBreakpoint', { text = '🟥', texthl = '', linehl = '', numhl = '' }) + vim.fn.sign_define('DapStopped', { text = '▶️', texthl = '', linehl = '', numhl = '' }) + require('mason-nvim-dap').setup { -- Makes a best effort to setup the various debuggers with -- reasonable debug configurations diff --git a/lua/custom/plugins/neodev.lua b/lua/custom/plugins/neodev.lua new file mode 100644 index 00000000..81416b5b --- /dev/null +++ b/lua/custom/plugins/neodev.lua @@ -0,0 +1,9 @@ +return { + "folke/neodev.nvim", + config = function() + require("neodev").setup({ + library = { plugins = { "nvim-dap-ui" }, types = true }, + }) + end, + opts = {}, +} diff --git a/lua/custom/plugins/noice.lua b/lua/custom/plugins/noice.lua new file mode 100644 index 00000000..0a2947f7 --- /dev/null +++ b/lua/custom/plugins/noice.lua @@ -0,0 +1,35 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + -- "rcarriga/nvim-notify", + }, + setup = function() + require("noice").setup({ + lsp = { + -- 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, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }) + end +} diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua index 90cdd1bc..2e8e8fd4 100644 --- a/lua/custom/plugins/trouble.lua +++ b/lua/custom/plugins/trouble.lua @@ -1,9 +1,9 @@ return { - -- "folke/trouble.nvim", - -- dependencies = { "nvim-tree/nvim-web-devicons" }, - -- opts = { - -- -- your configuration comes here - -- -- or leave it empty to use the default settings - -- -- refer to the configuration section below - -- }, + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, }