ui: nvim-notify for nvim's notifications
This commit is contained in:
parent
36a826d429
commit
d188262c02
3 changed files with 27 additions and 0 deletions
|
@ -8,6 +8,7 @@ vim.api.nvim_create_autocmd("FileType", { -- close some filetypes with <q>
|
|||
pattern = {
|
||||
"help",
|
||||
"man",
|
||||
"notify",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
|
|
|
@ -56,6 +56,7 @@ return {
|
|||
{ "<leader>tg", "<cmd>Telescope live_grep<cr>", desc = "grep files" },
|
||||
{ "<leader>th", "<cmd>Telescope help_tags<cr>", desc = "help" },
|
||||
{ "<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>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,
|
||||
},
|
||||
|
||||
|
|
24
lua/znvim/plugins/ui.lua
Normal file
24
lua/znvim/plugins/ui.lua
Normal 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,
|
||||
},
|
||||
},
|
Loading…
Reference in a new issue