nixvim!
This commit is contained in:
parent
1ae2d7cc6a
commit
6198767e5b
47 changed files with 2430 additions and 108 deletions
45
modules/editors/nixvim/plug/ui/nvim-notify.nix
Normal file
45
modules/editors/nixvim/plug/ui/nvim-notify.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
plugins.notify = {
|
||||
enable = true;
|
||||
backgroundColour = "#000000";
|
||||
fps = 60;
|
||||
render = "default";
|
||||
timeout = 1000;
|
||||
topDown = true;
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>un";
|
||||
action = ''
|
||||
<cmd>lua require("notify").dismiss({ silent = true, pending = true })<cr>
|
||||
'';
|
||||
options = {
|
||||
desc = "Dismiss All Notifications";
|
||||
};
|
||||
}
|
||||
];
|
||||
extraConfigLua = ''
|
||||
local notify = require("notify")
|
||||
|
||||
local filtered_message = { "No information available" }
|
||||
|
||||
-- Override notify function to filter out messages
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
vim.notify = function(message, level, opts)
|
||||
local merged_opts = vim.tbl_extend("force", {
|
||||
on_open = function(win)
|
||||
local buf = vim.api.nvim_win_get_buf(win)
|
||||
vim.api.nvim_buf_set_option(buf, "filetype", "markdown")
|
||||
end,
|
||||
}, opts or {})
|
||||
|
||||
for _, msg in ipairs(filtered_message) do
|
||||
if message == msg then
|
||||
return
|
||||
end
|
||||
end
|
||||
return notify(message, level, merged_opts)
|
||||
end
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue