From cd13160f83d06a41e779fef5a3e2d2094cede97c Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Tue, 2 May 2023 16:47:00 -0500 Subject: fix(nvim): clean up noice config --- nvim/.config/nvim/lua/tobyvin/plugins/noice.lua | 51 +++++-------------------- 1 file changed, 10 insertions(+), 41 deletions(-) (limited to 'nvim/.config') diff --git a/nvim/.config/nvim/lua/tobyvin/plugins/noice.lua b/nvim/.config/nvim/lua/tobyvin/plugins/noice.lua index 40f6f53..8a9e78e 100644 --- a/nvim/.config/nvim/lua/tobyvin/plugins/noice.lua +++ b/nvim/.config/nvim/lua/tobyvin/plugins/noice.lua @@ -7,6 +7,7 @@ local M = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify", }, + config = true, ---@type NoiceConfig opts = { cmdline = { enabled = false }, @@ -92,17 +93,17 @@ local M = { } function M.init() - vim.keymap.set("n", "nn", function() - require("noice").cmd("history") - end, { desc = "message history" }) + vim.api.nvim_set_hl(0, "NoiceLspProgressSpinner", { + link = require("tobyvin.utils.status").signs.spinner.texthl, + }) - vim.keymap.set("n", "nl", function() - require("noice").cmd("last") - end, { desc = "last message" }) + vim.api.nvim_set_hl(0, "NoiceLspProgressDone", { + link = require("tobyvin.utils.status").signs.done.texthl, + }) - vim.keymap.set("n", "ne", function() - require("noice").cmd("errors") - end, { desc = "error messages" }) + vim.keymap.set("n", "nn", function() + require("noice").cmd("last") + end, { desc = "last notification" }) vim.keymap.set({ "n", "i", "s" }, "", function() if not require("noice.lsp").scroll(4) then @@ -117,36 +118,4 @@ function M.init() end, { desc = "down half page and center", expr = true }) end ----@param opts NoiceConfig -function M.config(plugin, opts) - local augroup = vim.api.nvim_create_augroup(plugin.name, {}) - - vim.g.notify_send_enabled = false - vim.api.nvim_create_autocmd("FocusLost", { - group = augroup, - callback = function() - vim.g.notify_send_enabled = true - end, - desc = "Enable notify-send", - }) - - vim.api.nvim_create_autocmd("FocusGained", { - group = augroup, - callback = function() - vim.g.notify_send_enabled = false - end, - desc = "Disable notify-send", - }) - - vim.api.nvim_set_hl(0, "NoiceLspProgressSpinner", { - link = require("tobyvin.utils.status").signs.spinner.texthl, - }) - - vim.api.nvim_set_hl(0, "NoiceLspProgressDone", { - link = require("tobyvin.utils.status").signs.done.texthl, - }) - - require("noice").setup(opts) -end - return M -- cgit v1.2.3-70-g09d2