diff --git a/lua/lazyvim/plugins/init.lua b/lua/lazyvim/plugins/init.lua index 054c6f9a..ef352ee4 100644 --- a/lua/lazyvim/plugins/init.lua +++ b/lua/lazyvim/plugins/init.lua @@ -27,18 +27,30 @@ return { "folke/snacks.nvim", priority = 1000, lazy = false, - ---@type snacks.Config - opts = { - toggle = { map = LazyVim.safe_keymap_set }, - terminal = { - win = { - keys = { - nav_h = { "", term_nav("h"), desc = "Go to Left Window", expr = true, mode = "t" }, - nav_j = { "", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" }, - nav_k = { "", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" }, - nav_l = { "", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" }, + opts = function() + ---@type snacks.Config + return { + toggle = { map = LazyVim.safe_keymap_set }, + notifier = { enabled = not LazyVim.has("noice.nvim") }, + terminal = { + win = { + keys = { + nav_h = { "", term_nav("h"), desc = "Go to Left Window", expr = true, mode = "t" }, + nav_j = { "", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" }, + nav_k = { "", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" }, + nav_l = { "", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" }, + }, }, }, + } + end, + keys = { + { + "un", + function() + Snacks.notifier:hide() + end, + desc = "Dismiss All Notifications", }, }, }, diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 3d31e498..3e3399a3 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -1,39 +1,4 @@ return { - -- Better `vim.notify()` - { - "rcarriga/nvim-notify", - keys = { - { - "un", - function() - require("notify").dismiss({ silent = true, pending = true }) - end, - desc = "Dismiss All Notifications", - }, - }, - opts = { - stages = "static", - timeout = 3000, - max_height = function() - return math.floor(vim.o.lines * 0.75) - end, - max_width = function() - return math.floor(vim.o.columns * 0.75) - end, - on_open = function(win) - vim.api.nvim_win_set_config(win, { zindex = 100 }) - end, - }, - init = function() - -- when noice is not enabled, install notify on VeryLazy - if not LazyVim.has("noice.nvim") then - LazyVim.on_very_lazy(function() - vim.notify = require("notify") - end) - end - end, - }, - -- This is what powers LazyVim's fancy-looking -- tabs, which include filetype icons and close buttons. {