From ccdf0d4594c13f6450d32fc9927dd0987a0f4cb5 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sat, 26 Apr 2025 13:58:36 +0300 Subject: Added noice.nvim, might change some of the settings later --- .config/nvim/lua/plugins/auto-session.lua | 2 +- .config/nvim/lua/plugins/noice.lua | 99 +++++++++++++++++++++++++++++++ .config/nvim/lua/plugins/snacks.lua | 10 +++- 3 files changed, 108 insertions(+), 3 deletions(-) create mode 100644 .config/nvim/lua/plugins/noice.lua (limited to '.config/nvim/lua/plugins') diff --git a/.config/nvim/lua/plugins/auto-session.lua b/.config/nvim/lua/plugins/auto-session.lua index 649b82a..f46cb0c 100644 --- a/.config/nvim/lua/plugins/auto-session.lua +++ b/.config/nvim/lua/plugins/auto-session.lua @@ -2,7 +2,7 @@ return { 'rmagatti/auto-session', lazy = false, opts = { - auto_session_suppress_dirs = { '~/', '/' }, + suppressed_dirs = { '~/', '/' }, session_lens = { load_on_setup = false }, no_restore_cmds = { function() diff --git a/.config/nvim/lua/plugins/noice.lua b/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..5a35984 --- /dev/null +++ b/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,99 @@ +return { + 'folke/noice.nvim', + event = 'VeryLazy', + opts = { + notify = { enabled = false }, + lsp = { + progress = { enabled = false }, + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + -- override the default lsp markdown formatter with Noice + ['vim.lsp.util.convert_input_to_markdown_lines'] = true, + -- override the lsp markdown formatter with Noice + ['vim.lsp.util.stylize_markdown'] = true, + -- override cmp documentation with Noice (needs the other options to work) + ['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp + }, + hover = { + enabled = true, + silent = false, -- set to true to not show a message if hover is not available + view = nil, -- when nil, use defaults from documentation + ---@type NoiceViewOptions + opts = {}, -- merged with defaults from documentation + }, + signature = { + enabled = true, + auto_open = { + enabled = true, + trigger = true, -- Automatically show signature help when typing a trigger character from the LSP + luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes + throttle = 50, -- Debounce lsp signature help request by 50ms + }, + view = nil, -- when nil, use defaults from documentation + ---@type NoiceViewOptions + opts = {}, -- merged with defaults from documentation + }, + message = { + -- Messages shown by lsp servers + enabled = true, + view = 'notify', + opts = {}, + }, + -- defaults for hover and signature help + documentation = { + view = 'hover', + ---@type NoiceViewOptions + opts = { + lang = 'markdown', + replace = true, + render = 'plain', + format = { '{message}' }, + win_options = { concealcursor = 'n', conceallevel = 3 }, + }, + }, + }, + -- you can enable a preset for easier configuration + cmdline = { + enabled = true, -- enables the Noice cmdline UI + view = 'cmdline_popup', -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom + -- view = 'cmdline', -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom + format = { + cmdline = { pattern = '^:', icon = '', lang = 'vim' }, + search_down = { kind = 'search', pattern = '^/', icon = ' ', lang = 'regex' }, + search_up = { kind = 'search', pattern = '^%?', icon = ' ', lang = 'regex' }, + terminal = { pattern = '^:%s*!', icon = '$', lang = 'bash' }, + lua = { pattern = { '^:%s*lua%s+', '^:%s*lua%s*=%s*', '^:%s*=%s*' }, icon = '', lang = 'lua' }, + help = { pattern = '^:%s*he?l?p?%s+', icon = '' }, + input = { view = 'cmdline_input', icon = '󰥻 ' }, -- Used by input() + -- lua = false, -- to disable a format, set to `false` + }, + opts = {}, + }, + routes = { + { + filter = { + event = 'msg_show', + kind = 'search_count', + }, + opts = { skip = true }, + }, + { + filter = { + event = 'msg_show', + kind = '', + find = 'written', + }, + opts = { skip = true }, + }, + }, + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = true, -- add a border to hover docs and signature help + }, + }, + dependencies = { + 'MunifTanjim/nui.nvim', + }, +} diff --git a/.config/nvim/lua/plugins/snacks.lua b/.config/nvim/lua/plugins/snacks.lua index 83a12d4..278f5da 100644 --- a/.config/nvim/lua/plugins/snacks.lua +++ b/.config/nvim/lua/plugins/snacks.lua @@ -20,12 +20,18 @@ return { ---@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 + local exact_filter = { 'No information available', 'No code actions available' } + local contains_filter = { 'fewer lines', 'lines indented', 'lines yanked' } + for _, msg in ipairs(exact_filter) do if notif.msg == msg then return false end end + for _, msg in ipairs(contains_filter) do + if string.find(notif.msg, msg) then + return false + end + end return true end, }, -- cgit v1.3.1