1
0
Fork 0

ui: nvim-notify for nvim's notifications

This commit is contained in:
zymon 2024-08-27 11:52:53 +02:00
parent 36a826d429
commit d188262c02
3 changed files with 27 additions and 0 deletions

View file

@ -8,6 +8,7 @@ vim.api.nvim_create_autocmd("FileType", { -- close some filetypes with <q>
pattern = { pattern = {
"help", "help",
"man", "man",
"notify",
}, },
callback = function(event) callback = function(event)
vim.bo[event.buf].buflisted = false vim.bo[event.buf].buflisted = false

View file

@ -56,6 +56,7 @@ return {
{ "<leader>tg", "<cmd>Telescope live_grep<cr>", desc = "grep files" }, { "<leader>tg", "<cmd>Telescope live_grep<cr>", desc = "grep files" },
{ "<leader>th", "<cmd>Telescope help_tags<cr>", desc = "help" }, { "<leader>th", "<cmd>Telescope help_tags<cr>", desc = "help" },
{ "<leader>tk", "<cmd>Telescope keymaps<cr>", desc = "key maps" }, { "<leader>tk", "<cmd>Telescope keymaps<cr>", desc = "key maps" },
{ "<leader>tn", "<cmd>Telescope notify<cr>", desc = "notifications" },
{ "<leader>tss", "<cmd>Telescope symbols<cr>", desc = "symbols" }, { "<leader>tss", "<cmd>Telescope symbols<cr>", desc = "symbols" },
{ "<leader>tse", function () { "<leader>tse", function ()
require(telescope.builtin).symbols{ sources = {"emoji"} } require(telescope.builtin).symbols{ sources = {"emoji"} }
@ -97,6 +98,7 @@ return {
telescope.setup(opts) telescope.setup(opts)
telescope.load_extension("file_browser") telescope.load_extension("file_browser")
telescope.load_extension("bibtex") telescope.load_extension("bibtex")
telescope.load_extension("notify")
end, end,
}, },

24
lua/znvim/plugins/ui.lua Normal file
View file

@ -0,0 +1,24 @@
{ -- notification popups
"https://github.com/rcarriga/nvim-notify",
keys = {
{
"<leader>un",
function()
require("notify").dismiss({ silent = true, pending = true })
end,
desc = "clear notifications",
},
},
opts = {
stages = "fade_in_slide_out",
render = "compact",
background_colour = "#000000",
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,
},
},