58 lines
1.6 KiB
Lua
58 lines
1.6 KiB
Lua
return {
|
|
"rcarriga/nvim-notify",
|
|
|
|
keys = function()
|
|
local telescope_notifications = function()
|
|
local telescope = vim.F.npcall(require, "telescope")
|
|
if not telescope then
|
|
vim.notify("Telescope is not installed!", vim.log.levels.WARN)
|
|
return
|
|
end
|
|
|
|
local theme = require("telescope.themes").get_dropdown {
|
|
results_title = " Results ",
|
|
prompt_title = " Notifications ",
|
|
}
|
|
telescope.load_extension("notify").notify(theme)
|
|
end
|
|
|
|
local dismiss_notifications = function() require("notify").dismiss() end
|
|
|
|
local keymap = require("fschauen.plugins.telescope").keymap
|
|
|
|
return {
|
|
-- stylua: ignore start
|
|
{ "<leader>n", "<cmd>Notifications<cr>", desc = "Display notification history" },
|
|
{ "<c-q>", dismiss_notifications, desc = "Dismiss notifications" },
|
|
keymap { "n", telescope_notifications, desc = "[n]otifications" },
|
|
-- stylua: ignore end
|
|
}
|
|
end,
|
|
|
|
lazy = false,
|
|
|
|
config = function()
|
|
local notify = require("notify")
|
|
local icons = require("fschauen.util.icons")
|
|
|
|
notify.setup {
|
|
icons = {
|
|
ERROR = icons.diagnostics_bold.Error,
|
|
WARN = icons.diagnostics_bold.Warn,
|
|
INFO = icons.diagnostics.Info,
|
|
DEBUG = icons.diagnostics.Debug,
|
|
TRACE = icons.diagnostics.Trace,
|
|
},
|
|
fps = 24,
|
|
max_width = 50,
|
|
minimum_width = 50,
|
|
render = "wrapped-compact",
|
|
stages = "fade",
|
|
time_formats = {
|
|
notification_history = "%F %T │ ",
|
|
},
|
|
}
|
|
|
|
vim.notify = notify
|
|
end,
|
|
}
|