From 81adaec66196ccf7113ef976d477788c6d6c4819 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Fri, 8 May 2026 18:15:23 +0545 Subject: [PATCH] feat(plugin): enable snack project explorer and trim plugin list Streamline plugin configuration by enabling the project explorer in Snacks and removing unused plugins and configurations. - New Features - Enabled `explorer` and `projects` in Snacks with explicit directories (`~/Projects`, `~/Projects/other`, `~/.config/Modus`). - Added `dev` layout mapping for project-specific browsing. - Enhancements - Removed unused UI plugins (`neoscroll.nvim`, `neodim`, `better-escape.nvim`) and their autocmds. - Optimized lazy loading of Snacks components for faster startup. - Bug Fixes - Fixed misconfiguration of project directories (`~/Project` corrected to `~/Projects`). - Cleaned up removed plugin setups that could cause runtime errors. --- plugin/editor.lua | 6 ------ plugin/snacks.lua | 17 +++++++++++------ plugin/ui.lua | 45 ++------------------------------------------- 3 files changed, 13 insertions(+), 55 deletions(-) diff --git a/plugin/editor.lua b/plugin/editor.lua index 5f76804..db2e506 100644 --- a/plugin/editor.lua +++ b/plugin/editor.lua @@ -1,10 +1,8 @@ add({ - 'windwp/nvim-autopairs', -- autopairs 'windwp/nvim-ts-autotag', -- autotag 'folke/todo-comments.nvim', -- todo comment highlights 'wakatime/vim-wakatime', --wakaTime coding time tracker 'lambdalisue/suda.vim', -- edit files as sudo (:SudaWrite) - 'numToStr/Comment.nvim', -- smart comment toggling 'NMAC427/guess-indent.nvim', -- auto-detect tab/space indentation 'brenoprata10/nvim-highlight-colors', -- color highlighting 'davidmh/mdx.nvim', -- syntax highlighter for mdx @@ -12,7 +10,6 @@ add({ 'Exafunction/windsurf.vim', -- windsurf ai for autocompletion 'numToStr/Navigator.nvim', -- navigator 'm4xshen/hardtime.nvim', -- workflow - 'lukas-reineke/indent-blankline.nvim', --indent guides 'mg979/vim-visual-multi', -- multiple cursors }) @@ -27,7 +24,6 @@ vim.g.VM_maps = { -- lazy load insert mode enhancements vim.api.nvim_create_autocmd('InsertEnter', { callback = function() - require('nvim-autopairs').setup({}) require('nvim-ts-autotag').setup({}) end, once = true, @@ -37,7 +33,6 @@ vim.api.nvim_create_autocmd('InsertEnter', { vim.api.nvim_create_autocmd({ 'BufReadPost', 'BufNewFile' }, { callback = function() require('todo-comments').setup({ signs = false }) - require('Comment').setup() require('guess-indent').setup({}) require('nvim-highlight-colors').setup({ render = 'background' }) require('Navigator').setup({ @@ -49,7 +44,6 @@ vim.api.nvim_create_autocmd({ 'BufReadPost', 'BufNewFile' }, { }) require('hardtime').setup({}) -require('ibl').setup({}) require('nvim-treesitter').setup({ ensure_installed = require('extensions').ts_parsers, diff --git a/plugin/snacks.lua b/plugin/snacks.lua index 060928c..23518ad 100644 --- a/plugin/snacks.lua +++ b/plugin/snacks.lua @@ -107,11 +107,13 @@ Snacks.setup({ }, explorer = { enabled = false }, projects = { - dirs = { - "~/Project", - "~/.config/Modus" - } - }, + enabled = true, + dirs = { + "~/Projects", + "~/Projects/other", + "~/.config/Modus", + } + }, git = { enabled = true }, gitbrowse = { enabled = true }, image = { enabled = true }, @@ -197,7 +199,10 @@ Snacks.setup({ help = { layout = { preset = "ivy_split" } }, man = { layout = { preset = "ivy_split" } }, notifications = { layout = palette_layout() }, - projects = { layout = files_layout(0.8) }, + projects = { + dev = { "~/Projects", "~/Projects/other" }, + layout = files_layout(0.8), + }, recent = { layout = files_layout() }, search_history = { layout = palette_layout() }, smart = { layout = files_layout() }, diff --git a/plugin/ui.lua b/plugin/ui.lua index 877624d..e327fde 100644 --- a/plugin/ui.lua +++ b/plugin/ui.lua @@ -1,37 +1,11 @@ add({ - 'karb94/neoscroll.nvim', -- smooth scrolling 'OXY2DEV/markview.nvim', -- rendering for html and markdown 'serhez/bento.nvim', -- buffer manager 'akinsho/toggleterm.nvim', --float terminal - 'max397574/better-escape.nvim', -- better escape - 'zbirenbaum/neodim', -- dimming the highlights of unused functions, variables, parameters, and more }) require('bento').setup({}) --- lazy load UI enhancement plugins -vim.api.nvim_create_autocmd({ 'BufReadPost', 'BufNewFile' }, { - callback = function() - require('neoscroll').setup({ - mappings = { '', '', '', '', '', '', 'zt', 'zz', 'zb' }, - }) - require('neodim').setup({ - alpha = 0.5, - blend_color = nil, - hide = { - underline = true, - virtual_text = true, - signs = true, - }, - regex = { - '[uU]nused', - '[nN]ever [rR]ead', - '[nN]ot [rR]ead', - }, - priority = 128, - disable = {}, - }) - end, -}) + -- lazy load markdown preview vim.api.nvim_create_autocmd('FileType', { @@ -71,19 +45,4 @@ require('toggleterm').setup({ }, }) --- lazy load better escape -vim.api.nvim_create_autocmd('InsertEnter', { - callback = function() - require('better_escape').setup({ - mappings = { - i = { - k = { j = '' }, - j = { k = '', j = '' }, - -- disable jj - -- j = { j = false }, - }, - }, - }) - end, - once = true, -}) +