aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nvim
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2023-05-02 16:47:00 -0500
committerToby Vincent <tobyv13@gmail.com>2023-05-02 16:47:00 -0500
commitcd13160f83d06a41e779fef5a3e2d2094cede97c (patch)
treebfd1efd20903c9f69632c12f3c16ed6802d80965 /nvim
parent297405ed31215a6bf9d3b3c3946f47edf04d6773 (diff)
fix(nvim): clean up noice config
Diffstat (limited to 'nvim')
-rw-r--r--nvim/.config/nvim/lua/tobyvin/plugins/noice.lua51
1 files changed, 10 insertions, 41 deletions
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", "<leader>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", "<leader>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", "<leader>ne", function()
- require("noice").cmd("errors")
- end, { desc = "error messages" })
+ vim.keymap.set("n", "<leader>nn", function()
+ require("noice").cmd("last")
+ end, { desc = "last notification" })
vim.keymap.set({ "n", "i", "s" }, "<c-d>", 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