diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua index 06ccd4b..ca06282 100644 --- a/lua/plugins/snacks.lua +++ b/lua/plugins/snacks.lua @@ -16,10 +16,9 @@ return { dashboard = { sections = { { section = 'header' }, - { section = 'keys', gap = 1, padding = 1 }, - { title = 'Sessions', padding = 1 }, - { pane = 1, icon = ' ', title = 'Recent Files', section = 'recent_files', indent = 2, padding = 1 }, - { pane = 2, icon = ' ', title = 'Projects', section = 'projects', indent = 2, padding = 1 }, + { icon = ' ', title = 'Keymaps', section = 'keys', indent = 2, padding = 1 }, + { icon = ' ', title = 'Recent Files', section = 'recent_files', indent = 2, padding = 1 }, + { icon = ' ', title = 'Projects', section = 'projects', indent = 2, padding = 1 }, { section = 'startup' }, }, }, @@ -39,45 +38,204 @@ return { formatters = { file = { truncate = 100, - filename_first = true - } - } - } + filename_first = true, + }, + }, + }, }, keys = { - { 'g', function() Snacks.lazygit() end, desc = 'Lazygit', }, - { 'gf', function() Snacks.lazygit.log_file() end, desc = 'Lazygit Current File History', }, - { 'gl', function() Snacks.lazygit.log() end, desc = 'Lazygit Log (cwd)', }, - { 'm', function() Snacks.words.jump(vim.v.count1) end, desc = 'Next Reference', mode = { 'n' }, }, - { '', function() Snacks.words.jump(-vim.v.count1) end, desc = 'Prev Reference', mode = { 'n' }, }, + { + 'g', + function() + Snacks.lazygit() + end, + desc = 'Lazygit', + }, + { + 'gf', + function() + Snacks.lazygit.log_file() + end, + desc = 'Lazygit Current File History', + }, + { + 'gl', + function() + Snacks.lazygit.log() + end, + desc = 'Lazygit Log (cwd)', + }, + { + 'm', + function() + Snacks.words.jump(vim.v.count1) + end, + desc = 'Next Reference', + mode = { 'n' }, + }, + { + '', + function() + Snacks.words.jump(-vim.v.count1) + end, + desc = 'Prev Reference', + mode = { 'n' }, + }, -- Top Pickers & Explorer - { '', function() Snacks.picker.smart() end, desc = 'Smart Find Files' }, - { 'b', function() Snacks.picker.buffers() end, desc = 'Buffers' }, - { 'l', function() Snacks.picker.grep() end, desc = 'Grep' }, - { ':', function() Snacks.picker.command_history() end, desc = 'Command History' }, - { 'n', function() Snacks.picker.notifications() end, desc = 'Notification History' }, - { 'e', function() Snacks.explorer() end, desc = 'File Explorer' }, + { + '', + function() + Snacks.picker.smart() + end, + desc = 'Smart Find Files', + }, + { + 'b', + function() + Snacks.picker.buffers() + end, + desc = 'Buffers', + }, + { + 'l', + function() + Snacks.picker.grep() + end, + desc = 'Grep', + }, + { + ':', + function() + Snacks.picker.command_history() + end, + desc = 'Command History', + }, + { + 'n', + function() + Snacks.picker.notifications() + end, + desc = 'Notification History', + }, + { + 'e', + function() + Snacks.explorer() + end, + desc = 'File Explorer', + }, -- find -- { "fb", function() Snacks.picker.buffers() end, desc = "Buffers" }, -- { "f", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Find Config File" }, - { 'f', function() Snacks.picker.files() end, desc = 'Find Files' }, - { 'g', function() Snacks.picker.git_files() end, desc = 'Find Git Files' }, - { 'p', function() Snacks.picker.projects() end, desc = 'Projects' }, - { 'o', function() Snacks.picker.recent() end, desc = 'Recent' }, - { 'i', function() Snacks.picker.recent({ filter = { cwd = true } }) end, desc = 'Recent in cwd' }, + { + 'f', + function() + Snacks.picker.files() + end, + desc = 'Find Files', + }, + { + 'g', + function() + Snacks.picker.git_files() + end, + desc = 'Find Git Files', + }, + { + 'p', + function() + Snacks.picker.projects() + end, + desc = 'Projects', + }, + { + 'o', + function() + Snacks.picker.recent() + end, + desc = 'Recent', + }, + { + 'i', + function() + Snacks.picker.recent({ filter = { cwd = true } }) + end, + desc = 'Recent in cwd', + }, -- git - { "nb", function() Snacks.picker.git_branches() end, desc = "Git Branches" }, - { "nl", function() Snacks.picker.git_log() end, desc = "Git Log" }, - { "nL", function() Snacks.picker.git_log_line() end, desc = "Git Log Line" }, - { "ns", function() Snacks.picker.git_status() end, desc = "Git Status" }, - { "nS", function() Snacks.picker.git_stash() end, desc = "Git Stash" }, - { "nd", function() Snacks.picker.git_diff() end, desc = "Git Diff (Hunks)" }, - { "nf", function() Snacks.picker.git_log_file() end, desc = "Git Log File" }, + { + 'nb', + function() + Snacks.picker.git_branches() + end, + desc = 'Git Branches', + }, + { + 'nl', + function() + Snacks.picker.git_log() + end, + desc = 'Git Log', + }, + { + 'nL', + function() + Snacks.picker.git_log_line() + end, + desc = 'Git Log Line', + }, + { + 'ns', + function() + Snacks.picker.git_status() + end, + desc = 'Git Status', + }, + { + 'nS', + function() + Snacks.picker.git_stash() + end, + desc = 'Git Stash', + }, + { + 'nd', + function() + Snacks.picker.git_diff() + end, + desc = 'Git Diff (Hunks)', + }, + { + 'nf', + function() + Snacks.picker.git_log_file() + end, + desc = 'Git Log File', + }, -- Grep - { 'sb', function() Snacks.picker.lines() end, desc = 'Buffer Lines' }, - { 'sB', function() Snacks.picker.grep_buffers() end, desc = 'Grep Open Buffers' }, + { + 'sb', + function() + Snacks.picker.lines() + end, + desc = 'Buffer Lines', + }, + { + 'sB', + function() + Snacks.picker.grep_buffers() + end, + desc = 'Grep Open Buffers', + }, -- { "sg", function() Snacks.picker.grep() end, desc = "Grep" }, - { 'd', function() Snacks.picker.grep_word() end, desc = 'Visual selection or word', mode = { 'n', 'x' } }, + { + 'd', + function() + Snacks.picker.grep_word() + end, + desc = 'Visual selection or word', + mode = { 'n', 'x' }, + }, -- search -- { 's"', function() Snacks.picker.registers() end, desc = "Registers" }, -- { 's/', function() Snacks.picker.search_history() end, desc = "Search History" }, @@ -86,27 +244,148 @@ return { -- { "sc", function() Snacks.picker.command_history() end, desc = "Command History" }, -- { "sC", function() Snacks.picker.commands() end, desc = "Commands" }, -- { "v", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, - { 'V', 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' }, - { 'j', 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.marks() end, desc = "Marks" }, - { "sM", function() Snacks.picker.man() end, desc = "Man Pages" }, - { "sp", function() Snacks.picker.lazy() end, desc = "Search for Plugin Spec" }, - { "sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" }, - { "sR", function() Snacks.picker.resume() end, desc = "Resume" }, - { "su", function() Snacks.picker.undo() end, desc = "Undo History" }, + { + 'V', + 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', + }, + { + 'j', + 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.marks() + end, + desc = 'Marks', + }, + { + 'sM', + function() + Snacks.picker.man() + end, + desc = 'Man Pages', + }, + { + 'sp', + function() + Snacks.picker.lazy() + end, + desc = 'Search for Plugin Spec', + }, + { + 'sq', + function() + Snacks.picker.qflist() + end, + desc = 'Quickfix List', + }, + { + 'sR', + function() + Snacks.picker.resume() + end, + desc = 'Resume', + }, + { + 'su', + function() + Snacks.picker.undo() + end, + desc = 'Undo History', + }, -- { "uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" }, -- LSP - { 'd', function() Snacks.picker.lsp_definitions() end, desc = 'Goto Definition' }, - { 'D', function() Snacks.picker.lsp_declarations() end, desc = 'Goto Declaration' }, - { 'r', function() Snacks.picker.lsp_references() end, nowait = true, desc = 'References' }, - { 'I', function() Snacks.picker.lsp_implementations() end, desc = 'Goto Implementation' }, - { 'e', function() Snacks.picker.lsp_type_definitions() end, desc = 'Goto T[y]pe Definition' }, - { '', function() Snacks.picker.lsp_symbols() end, desc = 'LSP Symbols' }, - { 'sS', function() Snacks.picker.lsp_workspace_symbols() end, desc = 'LSP Workspace Symbols' }, + { + 'd', + function() + Snacks.picker.lsp_definitions() + end, + desc = 'Goto Definition', + }, + { + 'D', + function() + Snacks.picker.lsp_declarations() + end, + desc = 'Goto Declaration', + }, + { + 'r', + function() + Snacks.picker.lsp_references() + end, + nowait = true, + desc = 'References', + }, + { + 'I', + function() + Snacks.picker.lsp_implementations() + end, + desc = 'Goto Implementation', + }, + { + 'e', + function() + Snacks.picker.lsp_type_definitions() + end, + desc = 'Goto T[y]pe Definition', + }, + { + '', + function() + Snacks.picker.lsp_symbols() + end, + desc = 'LSP Symbols', + }, + { + 'sS', + function() + Snacks.picker.lsp_workspace_symbols() + end, + desc = 'LSP Workspace Symbols', + }, }, }