diff --git a/lazy-lock.json b/lazy-lock.json index 9e39661..32ffe75 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -12,11 +12,9 @@ "mason-lspconfig.nvim": { "branch": "main", "commit": "7b01e2974a47d489bb92f47a41e4c0088ea8f86e" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, - "mason.nvim": { "branch": "main", "commit": "cbf8d285e1462dd24acf3507817be2bbcb035919" }, + "mason.nvim": { "branch": "main", "commit": "bb639d4bf385a4d89f478b83af4d770be05ab7eb" }, "mini.icons": { "branch": "main", "commit": "520995f1d75da0e4cc901ee95080b1ff2bc46b94" }, - "mini.nvim": { "branch": "main", "commit": "6791615e48801cbf5b2baefadcea77a7760de3f4" }, - "neo-tree.nvim": { "branch": "main", "commit": "83e7a2982fd12b9c3d35bc39dd5877cd91a02a61" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "mini.nvim": { "branch": "main", "commit": "a405061478d8027b4e21214d897ce1eb33115792" }, "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, "nvim-dap": { "branch": "master", "commit": "531771530d4f82ad2d21e436e3cc052d68d7aebb" }, "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index d11173d..f3fccb9 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -4,12 +4,12 @@ Purpose Non-plugin (or minimally coupled) normal-mode maps: terminal escape, - window navigation, Neo-tree toggles, and visual paste without clobbering a register. + window navigation and visual paste without clobbering a register. Rationale Keeping these maps here avoids scattering `vim.keymap.set` across plugin config files and ensures they exist even before lazy.nvim finishes loading. - `go` (git browse) lives in `config.plugins.snacks`. + Explorer and `go` live in `config.plugins.snacks`. See `:help vim.keymap.set()`. ]] @@ -30,5 +30,3 @@ vim.keymap.set('n', 'tf', ':ToggleTerm', { desc = 'Toggle floating t vim.keymap.set('x', 'p', '"_dP', { noremap = true, silent = true }) -vim.keymap.set('n', 'x', 'Neotree toggle', { desc = 'NeoTree Toggle' }) -vim.keymap.set('n', 'z', 'Neotree reveal', { desc = 'NeoTree Reveal' }) diff --git a/lua/config/plugins/neo-tree.lua b/lua/config/plugins/neo-tree.lua deleted file mode 100644 index 60d7cf3..0000000 --- a/lua/config/plugins/neo-tree.lua +++ /dev/null @@ -1,47 +0,0 @@ ---[[ - Path: lua/config/plugins/neo-tree.lua - Module: config.plugins.neo-tree - - Purpose - Lazy spec for nvim-neo-tree/neo-tree.nvim: filesystem sidebar, reveal/toggle - keymaps, and tuned `filesystem` options (hidden files, libuv watcher, root). - - Rationale - Centralizes file-tree UX; `x` / `z` maps live in keymaps.lua. - Neo-tree spec lives alongside other Lazy modules under `config.plugins`. - - See https://github.com/nvim-neo-tree/neo-tree.nvim -]] - ----@module 'lazy' ----@type LazySpec -return { - { - 'nvim-neo-tree/neo-tree.nvim', - version = '*', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', - 'MunifTanjim/nui.nvim', - }, - lazy = false, - keys = { - { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, - }, - ---@module 'neo-tree' - ---@type neotree.Config - opts = { - filesystem = { - visible = false, - window = { - use_libuv_file_watcher = true, - mappings = { - ['\\'] = 'close_window', - ['.'] = 'set_root', - ['H'] = 'toggle_hidden', - }, - }, - }, - }, - }, -} diff --git a/lua/config/plugins/snacks.lua b/lua/config/plugins/snacks.lua index b5cd2ae..3dc5e48 100644 --- a/lua/config/plugins/snacks.lua +++ b/lua/config/plugins/snacks.lua @@ -3,8 +3,8 @@ Module: config.plugins.snacks Purpose - folke/snacks.nvim: picker (Telescope replacement), bigfile, quickfile, - input, gitbrowse, and words (LSP reference highlights + / [[ jumps). + folke/snacks.nvim: picker, explorer (replaces neo-tree), bigfile, quickfile, + input, gitbrowse, lazygit, and words. Rationale `priority` + `lazy = false` so quickfile can run before VimEnter on @@ -24,8 +24,18 @@ return { }, ---@type snacks.Config opts = { + explorer = { + replace_netrw = true, + }, picker = { ui_select = true, + sources = { + explorer = { + watch = true, + git_status = true, + git_untracked = true, + }, + }, }, bigfile = {}, quickfile = {}, @@ -39,6 +49,17 @@ return { config = function() local picker = Snacks.picker + local function explorer_toggle() + local current = Snacks.picker.current + if current and current.opts.source == 'explorer' then + current:close() + return + end + Snacks.explorer() + end + + vim.keymap.set('n', 'x', explorer_toggle, { desc = 'Explorer toggle' }) + vim.keymap.set('n', 'sh', picker.help, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', picker.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', picker.files, { desc = '[S]earch [F]iles' }) diff --git a/lua/config/plugins/spec.lua b/lua/config/plugins/spec.lua index 1a8cc39..9912d12 100644 --- a/lua/config/plugins/spec.lua +++ b/lua/config/plugins/spec.lua @@ -48,7 +48,6 @@ local mods = { 'config.plugins.indent_line', 'config.plugins.lint', 'config.plugins.autopairs', - 'config.plugins.neo-tree', 'config.plugins.kulala', }