From 20c2b9933f9b11f2f3e3f3a6de25d9e8bfcf69f7 Mon Sep 17 00:00:00 2001 From: chuyanlong Date: Sun, 28 Sep 2025 21:50:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8F=92=E4=BB=B6=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins/extras/editor/snacks_picker.lua | 55 +++++-------------- 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua index 591da5ea..b0b7b95b 100644 --- a/lua/lazyvim/plugins/extras/editor/snacks_picker.lua +++ b/lua/lazyvim/plugins/extras/editor/snacks_picker.lua @@ -56,52 +56,25 @@ return { }, -- stylua: ignore keys = { - { ",", function() Snacks.picker.buffers() end, desc = "Buffers" }, - { "/", LazyVim.pick("grep"), desc = "Grep (Root Dir)" }, - { ":", function() Snacks.picker.command_history() end, desc = "Command History" }, - { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, - { "n", function() Snacks.picker.notifications() end, desc = "Notification History" }, -- find { "fb", function() Snacks.picker.buffers() end, desc = "Buffers" }, - { "fB", function() Snacks.picker.buffers({ hidden = true, nofile = true }) end, desc = "Buffers (all)" }, { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, - { "fg", function() Snacks.picker.git_files() end, desc = "Find Files (git-files)" }, - { "fr", LazyVim.pick("oldfiles"), desc = "Recent" }, - { "fR", function() Snacks.picker.recent({ filter = { cwd = true }}) end, desc = "Recent (cwd)" }, { "fp", function() Snacks.picker.projects() end, desc = "Projects" }, - -- git - { "gd", function() Snacks.picker.git_diff() end, desc = "Git Diff (hunks)" }, - { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, - { "gS", function() Snacks.picker.git_stash() end, desc = "Git Stash" }, -- Grep - { "sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" }, - { "sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" }, - { "sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, - { "sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, - { "sp", function() Snacks.picker.lazy() end, desc = "Search for Plugin Spec" }, - { "sw", LazyVim.pick("grep_word"), desc = "Visual selection or word (Root Dir)", mode = { "n", "x" } }, - { "sW", LazyVim.pick("grep_word", { root = false }), desc = "Visual selection or word (cwd)", mode = { "n", "x" } }, + { "fz", function() Snacks.picker.lines() end, desc = "Buffer Lines" }, + { "fg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, + { "fG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, + { "fw", LazyVim.pick("grep_word"), desc = "Visual selection or word (Root Dir)", mode = { "n", "x" } }, + { "fW", LazyVim.pick("grep_word", { root = false }), desc = "Visual selection or word (cwd)", mode = { "n", "x" } }, -- search - { 's"', function() Snacks.picker.registers() end, desc = "Registers" }, - { 's/', function() Snacks.picker.search_history() end, desc = "Search History" }, - { "sa", function() Snacks.picker.autocmds() end, desc = "Autocmds" }, - { "sc", function() Snacks.picker.command_history() end, desc = "Command History" }, - { "sC", function() Snacks.picker.commands() end, desc = "Commands" }, - { "sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, - { "sD", function() Snacks.picker.diagnostics_buffer() end, desc = "Buffer Diagnostics" }, - { "sh", function() Snacks.picker.help() end, desc = "Help Pages" }, - { "sH", function() Snacks.picker.highlights() end, desc = "Highlights" }, - { "si", function() Snacks.picker.icons() end, desc = "Icons" }, - { "sj", function() Snacks.picker.jumps() end, desc = "Jumps" }, - { "sk", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, - { "sl", function() Snacks.picker.loclist() end, desc = "Location List" }, - { "sM", function() Snacks.picker.man() end, desc = "Man Pages" }, - { "sm", function() Snacks.picker.marks() end, desc = "Marks" }, - { "sR", function() Snacks.picker.resume() end, desc = "Resume" }, - { "sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" }, - { "su", function() Snacks.picker.undo() end, desc = "Undotree" }, + { 'f"', function() Snacks.picker.registers() end, desc = "Registers" }, + { 'fH', function() Snacks.picker.search_history() end, desc = "Search History" }, + { "fC", function() Snacks.picker.command_history() end, desc = "Command History" }, + { "fI", function() Snacks.picker.icons() end, desc = "Icons" }, + { "fK", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, + { "f", function() Snacks.picker.resume() end, desc = "Resume" }, -- ui { "uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" }, }, @@ -142,8 +115,6 @@ return { { "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, - { "ss", function() Snacks.picker.lsp_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Symbols", has = "documentSymbol" }, - { "sS", function() Snacks.picker.lsp_workspace_symbols({ filter = LazyVim.config.kind_filter }) end, desc = "LSP Workspace Symbols", has = "workspace/symbols" }, }) end, }, @@ -152,8 +123,8 @@ return { optional = true, -- stylua: ignore keys = { - { "st", function() Snacks.picker.todo_comments() end, desc = "Todo" }, - { "sT", function () Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, + { "ft", function() Snacks.picker.todo_comments() end, desc = "Todo" }, + { "fT", function () Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, }, }, {