vim: add plugin 'rcarriga/nvim-notify'

This commit is contained in:
Fernando Schauenburg 2024-02-17 23:09:52 +01:00
parent f84b35600b
commit 3011a077d3
2 changed files with 49 additions and 0 deletions

View file

@ -24,6 +24,7 @@
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
"nvim-lspconfig": { "branch": "master", "commit": "1bc83418927003552505ec66fa5d6cffae953f6a" }, "nvim-lspconfig": { "branch": "master", "commit": "1bc83418927003552505ec66fa5d6cffae953f6a" },
"nvim-luaref": { "branch": "main", "commit": "9cd3ed50d5752ffd56d88dd9e395ddd3dc2c7127" }, "nvim-luaref": { "branch": "main", "commit": "9cd3ed50d5752ffd56d88dd9e395ddd3dc2c7127" },
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
"nvim-tree.lua": { "branch": "master", "commit": "8cbb1db8e90b62fc56f379992e622e9f919792ce" }, "nvim-tree.lua": { "branch": "master", "commit": "8cbb1db8e90b62fc56f379992e622e9f919792ce" },
"nvim-treesitter": { "branch": "master", "commit": "b444afa1dacd3d031c0ffe4763671d89afda5ddb" }, "nvim-treesitter": { "branch": "master", "commit": "b444afa1dacd3d031c0ffe4763671d89afda5ddb" },
"nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" },

View file

@ -0,0 +1,48 @@
local M = { 'rcarriga/nvim-notify' }
local telescope_notify = function()
local ts = vim.F.npcall(require, 'telescope')
if not ts then return end
local theme = require('telescope.themes').get_dropdown {
results_title = ' Results ',
prompt_title = '  Notifications ',
}
local notify = ts.extensions.notify or ts.load_extension('notify')
notify.notify(theme)
end
M.keys = {
{ '<leader>n', '<cmd>Notifications<cr>', desc = 'Display notification history' },
{ '<leader>fn', telescope_notify, desc = ' [N]otifications' },
}
M.lazy = false
M.config = function()
local icons = require('fschauen.icons')
local notify = require('notify')
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' },
top_down = true,
}
vim.notify = notify
end
return M