From 67a4bc03ac81be48911de51337e1065cfe96425b Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 24 Apr 2025 20:34:48 +0300 Subject: Replaced telescope and trouble with snacks picker --- .config/nvim/lua/plugins/snacks.lua | 116 ++++++++++++++++++++++++++++- .config/nvim/lua/plugins/telescope.lua | 22 ------ .config/nvim/lua/plugins/todo-comments.lua | 19 ++++- .config/nvim/lua/plugins/trouble.lua | 40 ---------- 4 files changed, 131 insertions(+), 66 deletions(-) delete mode 100644 .config/nvim/lua/plugins/telescope.lua delete mode 100644 .config/nvim/lua/plugins/trouble.lua (limited to '.config/nvim/lua/plugins') diff --git a/.config/nvim/lua/plugins/snacks.lua b/.config/nvim/lua/plugins/snacks.lua index 5e00a23..02c5e35 100644 --- a/.config/nvim/lua/plugins/snacks.lua +++ b/.config/nvim/lua/plugins/snacks.lua @@ -23,6 +23,7 @@ return { return true end, }, + picker = {}, }, keys = { { @@ -45,11 +46,11 @@ return { }, { - 'si', + 'ri', function() Snacks.image.hover() end, - desc = '[S]how [I]mage', + desc = '[R]ender [I]mage', }, { @@ -66,5 +67,116 @@ return { end, desc = '[N]otification [H]istory', }, + + { + 'sp', + function() + Snacks.picker.pickers({ layout = 'telescope' }) + end, + desc = '[S]how [P]ickers', + }, + { + 'fs', + function() + Snacks.picker.files({ + layout = 'telescope', + hidden = true, + follow = true, + }) + end, + desc = '[F]ile [S]ystem', + }, + { + 'lv', + function() + Snacks.picker.grep({ + layout = 'telescope', + hidden = true, + follow = true, + }) + end, + desc = '[L]ive [G]rep', + }, + { + 'gi', + function() + Snacks.picker.lsp_implementations() + end, + { desc = '[G]oto [I]mplementations' }, + }, + { + 'gt', + function() + Snacks.picker.lsp_type_definitions() + end, + { desc = '[G]oto [T]ype Definitions' }, + }, + { + 'ds', + function() + Snacks.picker.lsp_symbols({ layout = 'telescope' }) + end, + desc = '[D]ocument [S]ymbols', + }, + { + 'ps', + function() + Snacks.picker.lsp_workspace_symbols({ layout = 'telescope' }) + end, + desc = '[P]roject [S]ymbols', + }, + { + 'di', + function() + Snacks.picker.diagnostics({ layout = 'telescope' }) + end, + desc = '[Di]agnostics', + }, + { + 'dl', + function() + Snacks.picker.diagnostics_buffer({ layout = 'telescope' }) + end, + desc = '[D]iagnostics [L]ocal', + }, + { + 'fh', + function() + Snacks.picker.help({ layout = 'telescope' }) + end, + desc = '[F]ind [H]elp', + }, + { + 'hi', + function() + Snacks.picker.highlights({ + layout = 'telescope', + hidden = true, + follow = true, + }) + end, + desc = '[Hi]light Groups', + }, + { + 'si', + function() + Snacks.picker.icons({ layout = 'select' }) + end, + desc = '[S]earch [I]cons', + }, + { + 'sk', + function() + Snacks.picker.keymaps({ layout = 'dropdown' }) + end, + desc = '[S]earch [K]eymaps', + }, + { + 'th', + function() + Snacks.picker.colorschemes({ layout = 'dropdown' }) + end, + desc = '[T]hemes [P]icker', + }, }, } diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua deleted file mode 100644 index b3e09af..0000000 --- a/.config/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - 'nvim-telescope/telescope.nvim', - tag = '0.1.5', - dependencies = { - 'nvim-lua/plenary.nvim', - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, - 'nvim-telescope/telescope-ui-select.nvim', - }, - cmd = 'Telescope', - config = function() - require('telescope_helper') - end, - keys = { - 'fs', - 'fa', - 'fh', - 'fm', - 'lv', - 'f.', - 'th', - }, -} diff --git a/.config/nvim/lua/plugins/todo-comments.lua b/.config/nvim/lua/plugins/todo-comments.lua index 799afd8..b19ad05 100644 --- a/.config/nvim/lua/plugins/todo-comments.lua +++ b/.config/nvim/lua/plugins/todo-comments.lua @@ -13,8 +13,23 @@ return { dependencies = { 'nvim-lua/plenary.nvim' }, event = 'VeryLazy', keys = { - { 'st', 'TodoTelescope keywords=TODO,FIX', desc = '[S]earch [T]odos' }, - { 'lt', 'TodoTrouble', desc = '[L]ist [T]odos' }, + { + 'st', + function() + Snacks.picker.todo_comments({ + layout = 'telescope', + keywords = { 'TODO', 'FIX', 'FIXME', 'BUG', 'ISSUE', 'OPTIMIZE' }, + }) + end, + desc = '[S]earch [T]odos', + }, + { + 'sn', + function() + Snacks.picker.todo_comments({ layout = 'telescope' }) + end, + desc = '[S]earch [N]otes', + }, }, config = function() require('todo-comments').setup({ diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua deleted file mode 100644 index 3239aa7..0000000 --- a/.config/nvim/lua/plugins/trouble.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - 'folke/trouble.nvim', - opts = {}, - cmd = 'Trouble', - -- TODO: Consider maybe using this for outlines (code structure) - -- and also configuring some of the keys to better fit me - -- and probably removing most of them in the process - keys = { - { - 'xx', - 'Trouble diagnostics toggle', - desc = 'Diagnostics (Trouble)', - }, - { - 'xX', - 'Trouble diagnostics toggle filter.buf=0', - desc = 'Buffer Diagnostics (Trouble)', - }, - { - 'cs', - 'Trouble symbols toggle focus=false', - desc = 'Symbols (Trouble)', - }, - { - 'cl', - 'Trouble lsp toggle focus=false win.position=right', - desc = 'LSP Definitions / references / ... (Trouble)', - }, - { - 'xL', - 'Trouble loclist toggle', - desc = 'Location List (Trouble)', - }, - { - 'xQ', - 'Trouble qflist toggle', - desc = 'Quickfix List (Trouble)', - }, - }, -} -- cgit v1.3.1