diff --git a/lua/znvim/autocmds.lua b/lua/znvim/autocmds.lua index f64089a..759d6af 100644 --- a/lua/znvim/autocmds.lua +++ b/lua/znvim/autocmds.lua @@ -8,6 +8,7 @@ vim.api.nvim_create_autocmd("FileType", { -- close some filetypes with pattern = { "help", "man", + "notify", }, callback = function(event) vim.bo[event.buf].buflisted = false diff --git a/lua/znvim/plugins/editor.lua b/lua/znvim/plugins/editor.lua index 4ff4b0c..e83c3b3 100644 --- a/lua/znvim/plugins/editor.lua +++ b/lua/znvim/plugins/editor.lua @@ -56,6 +56,7 @@ return { { "tg", "Telescope live_grep", desc = "grep files" }, { "th", "Telescope help_tags", desc = "help" }, { "tk", "Telescope keymaps", desc = "key maps" }, + { "tn", "Telescope notify", desc = "notifications" }, { "tss", "Telescope symbols", desc = "symbols" }, { "tse", function () require(telescope.builtin).symbols{ sources = {"emoji"} } @@ -97,6 +98,7 @@ return { telescope.setup(opts) telescope.load_extension("file_browser") telescope.load_extension("bibtex") + telescope.load_extension("notify") end, }, diff --git a/lua/znvim/plugins/ui.lua b/lua/znvim/plugins/ui.lua new file mode 100644 index 0000000..2073329 --- /dev/null +++ b/lua/znvim/plugins/ui.lua @@ -0,0 +1,24 @@ + { -- notification popups + "https://github.com/rcarriga/nvim-notify", + keys = { + { + "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, + }, + },