mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-18 01:34:32 +02:00
feat(snacks): use snacks notifier instead of nvim-notify
This commit is contained in:
parent
b006ac7afb
commit
b6ddeb2341
2 changed files with 22 additions and 45 deletions
|
@ -27,18 +27,30 @@ return {
|
||||||
"folke/snacks.nvim",
|
"folke/snacks.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
lazy = false,
|
lazy = false,
|
||||||
---@type snacks.Config
|
opts = function()
|
||||||
opts = {
|
---@type snacks.Config
|
||||||
toggle = { map = LazyVim.safe_keymap_set },
|
return {
|
||||||
terminal = {
|
toggle = { map = LazyVim.safe_keymap_set },
|
||||||
win = {
|
notifier = { enabled = not LazyVim.has("noice.nvim") },
|
||||||
keys = {
|
terminal = {
|
||||||
nav_h = { "<C-h>", term_nav("h"), desc = "Go to Left Window", expr = true, mode = "t" },
|
win = {
|
||||||
nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" },
|
keys = {
|
||||||
nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" },
|
nav_h = { "<C-h>", term_nav("h"), desc = "Go to Left Window", expr = true, mode = "t" },
|
||||||
nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" },
|
nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" },
|
||||||
|
nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" },
|
||||||
|
nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>un",
|
||||||
|
function()
|
||||||
|
Snacks.notifier:hide()
|
||||||
|
end,
|
||||||
|
desc = "Dismiss All Notifications",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,39 +1,4 @@
|
||||||
return {
|
return {
|
||||||
-- Better `vim.notify()`
|
|
||||||
{
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>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
|
-- This is what powers LazyVim's fancy-looking
|
||||||
-- tabs, which include filetype icons and close buttons.
|
-- tabs, which include filetype icons and close buttons.
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue