Skip to content

Commit

Permalink
feat: add UI plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
glwbr committed Jun 29, 2024
1 parent 54c9423 commit 02c57e7
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
5 changes: 5 additions & 0 deletions home/editors/neovim/plugins/ui/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_: {
imports = [
./notify.nix
];
}
46 changes: 46 additions & 0 deletions home/editors/neovim/plugins/ui/notify.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
_: {
programs.nixvim = {
plugins.notify = {
enable = true;
backgroundColour = "#000000";
fps = 60;
render = "default";
timeout = 500;
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
'';
};
}

0 comments on commit 02c57e7

Please sign in to comment.