From 007f71ce692f32b7b57a048bf55348aca3c9933d Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 24 Apr 2025 11:09:38 +0300 Subject: [PATCH] Replaced nvim-notify with snacks notifier and downloaded some more programs for pdf/latex image support for snacks --- .config/nvim/lua/custom/globals.lua | 3 +- .config/nvim/lua/custom/plugins/lazydev.lua | 5 ++- .../nvim/lua/custom/plugins/nvim-notify.lua | 34 ----------------- .config/nvim/lua/custom/plugins/snacks.lua | 37 ++++++++++++++++--- hosts/home.nix | 3 ++ 5 files changed, 39 insertions(+), 43 deletions(-) delete mode 100644 .config/nvim/lua/custom/plugins/nvim-notify.lua diff --git a/.config/nvim/lua/custom/globals.lua b/.config/nvim/lua/custom/globals.lua index 106009a..25f26d1 100644 --- a/.config/nvim/lua/custom/globals.lua +++ b/.config/nvim/lua/custom/globals.lua @@ -6,8 +6,7 @@ function Notify(message, title, level) title = level end end - local notify = require('notify') - notify(message, level, { title = ' ' .. title }) + vim.notify(message, level, { title = ' ' .. title }) end function ToggleWrap() diff --git a/.config/nvim/lua/custom/plugins/lazydev.lua b/.config/nvim/lua/custom/plugins/lazydev.lua index 35963b3..59d2366 100644 --- a/.config/nvim/lua/custom/plugins/lazydev.lua +++ b/.config/nvim/lua/custom/plugins/lazydev.lua @@ -1,9 +1,12 @@ return { 'folke/lazydev.nvim', ft = 'lua', + cmd = 'LazyDev', opts = { library = { - { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + { path = '${3rd}/luv/library', words = { 'vim%.uv' } }, + { path = 'snacks.nvim', words = { 'Snacks' } }, + { path = 'lazy.nvim', words = { 'LazyVim' } }, }, }, } diff --git a/.config/nvim/lua/custom/plugins/nvim-notify.lua b/.config/nvim/lua/custom/plugins/nvim-notify.lua deleted file mode 100644 index 34942ca..0000000 --- a/.config/nvim/lua/custom/plugins/nvim-notify.lua +++ /dev/null @@ -1,34 +0,0 @@ -return { - 'rcarriga/nvim-notify', - event = 'VeryLazy', - keys = { - { - 'nd', - function() - require('notify').dismiss({ silent = true, pending = true }) - end, - desc = '[N]otify [D]ismiss All', - }, - }, - opts = function() - -- Filter messages - local filtered_messages = { 'No information available', 'No code actions available' } - ---@diagnostic disable-next-line: duplicate-set-field - vim.notify = function(message, level, opts) - opts = opts or {} - for _, msg in ipairs(filtered_messages) do - if message == msg then - return - end - end - return require('notify')(message, level, opts) - end - return { - background_colour = '#000000', - fps = 60, - render = 'default', - timeout = 500, - topDown = true, - } - end, -} diff --git a/.config/nvim/lua/custom/plugins/snacks.lua b/.config/nvim/lua/custom/plugins/snacks.lua index c5bda80..50f4ff2 100644 --- a/.config/nvim/lua/custom/plugins/snacks.lua +++ b/.config/nvim/lua/custom/plugins/snacks.lua @@ -1,20 +1,45 @@ return { 'folke/snacks.nvim', + priority = 1000, + lazy = false, ---@type snacks.Config opts = { - image = { - -- your image configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below + image = {}, + ---@class snacks.notifier.Config + notifier = { + ---@type snacks.notifier.style + style = 'compact', + filter = function(notif) + local filtered_messages = { 'No information available', 'No code actions available' } + for _, msg in ipairs(filtered_messages) do + if notif.msg == msg then + return false + end + end + return true + end, }, }, keys = { { 'si', function() - require('snacks').image.hover() + Snacks.image.hover() end, }, + { + 'nd', + function() + Snacks.notifier.hide() + end, + desc = '[N]otifications [D]ismiss All', + }, + { + 'nh', + function() + Snacks.notifier.show_history() + end, + desc = '[N]otifications [D]ismiss All', + }, }, - lazy = false, } diff --git a/hosts/home.nix b/hosts/home.nix index 25ea187..25189d8 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -97,6 +97,9 @@ prismlauncher cloudflare-warp drawio + tree-sitter + tectonic + mermaid-cli ]; # For nixd LSP to recognize what nixpkgs version I use