From 4dfe6c4c33be8c3cac301eac401eb3a54c3e3ba5 Mon Sep 17 00:00:00 2001 From: iofq Date: Sat, 15 Mar 2025 01:34:46 -0500 Subject: [PATCH] refactor(flake): tidy up inputs attrset --- flake.lock | 54 +++---- flake.nix | 17 +- nix/neovim-overlay.nix | 5 +- nvim/lua/config/init.lua | 35 +---- nvim/lua/plugins/ai.lua | 23 +-- nvim/lua/plugins/completion.lua | 94 ++++------- nvim/lua/plugins/lsp.lua | 24 ++- nvim/lua/plugins/misc.lua | 41 ++--- nvim/lua/plugins/snacks.lua | 265 +++++++++++++++++--------------- 9 files changed, 263 insertions(+), 295 deletions(-) diff --git a/flake.lock b/flake.lock index 3a98af2..2ad9b49 100644 --- a/flake.lock +++ b/flake.lock @@ -96,11 +96,11 @@ ] }, "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "lastModified": 1741352980, + "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", "type": "github" }, "original": { @@ -183,11 +183,11 @@ ] }, "locked": { - "lastModified": 1741379162, - "narHash": "sha256-srpAbmJapkaqGRE3ytf3bj4XshspVR5964OX5LfjDWc=", + "lastModified": 1742649964, + "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "b5a62751225b2f62ff3147d0a334055ebadcd5cc", + "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", "type": "github" }, "original": { @@ -249,11 +249,11 @@ ] }, "locked": { - "lastModified": 1739595404, - "narHash": "sha256-0CjCfbq0yHWexOrpO06e2WU1r5JAqR6ffy1zgM3NksI=", + "lastModified": 1742014779, + "narHash": "sha256-I6fG1zrfdLFcp/imGZElig0BJO3YU0QEXLgvwWoOpJ8=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "06519cec8fb32d219006da6eacd255504a9996af", + "rev": "524637ef84c177661690b924bf64a1ce18072a2c", "type": "github" }, "original": { @@ -289,11 +289,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1741738202, - "narHash": "sha256-S98JgCHJJFBI9XFXPdn/ATjux6JfrjLN7jGHEGvxsYM=", + "lastModified": 1743293377, + "narHash": "sha256-DqvBHtTslU0E+XMW6xM4SY3UD3+nHAAIXHag0zukrpc=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "6e291160fc740378dc846f9bb402653c4e50a313", + "rev": "3f10166b5b818227b9d7728f97e67e11cdf27ffd", "type": "github" }, "original": { @@ -305,11 +305,11 @@ "neovim-src": { "flake": false, "locked": { - "lastModified": 1741737177, - "narHash": "sha256-MxPM5FawrHrUywZXAHJ4+0+Wj4dITHDMHKf4aIwC9zk=", + "lastModified": 1743289921, + "narHash": "sha256-0gsBH+wMZJaXb95GKP6OZmtyhlJh0lS/gsn6J8rxt6k=", "owner": "neovim", "repo": "neovim", - "rev": "092529ebbf6fe566399aa47c274d708b8dea5334", + "rev": "99529577cc9f5229cbb3dac8ab4782bd43094102", "type": "github" }, "original": { @@ -320,11 +320,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741678040, - "narHash": "sha256-rmBsz7BBcDwfvDkxnKHmolKceGJrr0nyz5PQYZg0kMk=", + "lastModified": 1743076231, + "narHash": "sha256-yQugdVfi316qUfqzN8JMaA2vixl+45GxNm4oUfXlbgw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3ee8818da146871cd570b164fc4f438f78479a50", + "rev": "6c5963357f3c1c840201eda129a99d455074db04", "type": "github" }, "original": { @@ -348,11 +348,11 @@ }, "nixpkgs-master": { "locked": { - "lastModified": 1741842650, - "narHash": "sha256-gyA3ngXZroBeWdrVsM+bL63hQMUheYCrC+V78TEgBeU=", + "lastModified": 1743392618, + "narHash": "sha256-lc4l0nV5WgnS4wuZrX7Na2tRBEpe2IzWmLnhm3+t3Tk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b1f2198021490b51fb92b8b09db97b9ba2a7b4ce", + "rev": "cd6f6791e94d08b983fe6d127ec6942176737f6a", "type": "github" }, "original": { @@ -380,11 +380,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1741513245, - "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", + "lastModified": 1743315132, + "narHash": "sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om+D4UnDhlDW9BE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", + "rev": "52faf482a3889b7619003c0daec593a1912fddc1", "type": "github" }, "original": { @@ -426,11 +426,11 @@ ] }, "locked": { - "lastModified": 1739829690, - "narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=", + "lastModified": 1743081648, + "narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "3d0579f5cc93436052d94b73925b48973a104204", + "rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ee4dbe2..4571818 100644 --- a/flake.nix +++ b/flake.nix @@ -10,13 +10,17 @@ url = "github:mrcjkb/nix-gen-luarc-json"; inputs.nixpkgs.follows = "nixpkgs"; }; + # Add bleeding-edge plugins here. + # They can be updated with `nix flake update` (make sure to commit the generated flake.lock) + # wf-nvim = { + # url = "github:Cassin01/wf.nvim"; + # flake = false; + # }; }; - outputs = inputs @ { self, nixpkgs, flake-utils, - gen-luarc, ... }: let systems = builtins.attrNames nixpkgs.legacyPackages; @@ -27,10 +31,14 @@ flake-utils.lib.eachSystem systems (system: let pkgs = import nixpkgs { inherit system; + config.allowUnfree = true; overlays = [ - inputs.neovim-nightly-overlay.overlays.default - gen-luarc.overlays.default + # inputs.neovim-nightly-overlay.overlays.default neovim-overlay + # This adds a function can be used to generate a .luarc.json + # containing the Neovim API all plugins in the workspace directory. + # The generated file can be symlinked in the devShell's shellHook. + inputs.gen-luarc.overlays.default ]; }; shell = pkgs.mkShell { @@ -43,6 +51,7 @@ nvim-dev ]; shellHook = '' + # symlink the .luarc.json generated in the overlay ln -fs ${pkgs.nvim-luarc-json} .luarc.json # allow quick iteration of lua configs ln -Tfns $PWD/nvim ~/.config/nvim-dev diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index bfe71a7..df3df0f 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -13,17 +13,15 @@ with final.pkgs.lib; let all-plugins = with pkgs.vimPlugins; [ blink-cmp + blink-copilot blink-ripgrep-nvim codecompanion-nvim conform-nvim copilot-lua diffview-nvim eyeliner-nvim - friendly-snippets gitsigns-nvim - hunk-nvim lazy-nvim - luasnip mini-nvim neogit nightfox-nvim @@ -60,7 +58,6 @@ with final.pkgs.lib; let nil phpactor python312Packages.jedi-language-server - ruby-lsp #other jujutsu diff --git a/nvim/lua/config/init.lua b/nvim/lua/config/init.lua index 5535ce6..e3a42c9 100644 --- a/nvim/lua/config/init.lua +++ b/nvim/lua/config/init.lua @@ -17,6 +17,7 @@ vim.opt.swapfile = false vim.opt.tabstop = 2 -- 2 space tabs are based vim.opt.updatetime = 250 -- decrease update time vim.opt.virtualedit = 'onemore' +vim.opt.winborder = 'single' -- Switch tab length on the fly vim.keymap.set('n', '\\t', function() @@ -43,56 +44,26 @@ vim.api.nvim_create_autocmd('BufWinEnter', { }) -- Configure Neovim diagnostic messages -local function prefix_diagnostic(prefix, diagnostic) - return string.format(prefix .. ' %s', diagnostic.message) -end vim.diagnostic.config { virtual_text = { - prefix = '', - format = function(diagnostic) - local severity = diagnostic.severity - if severity == vim.diagnostic.severity.ERROR then - return prefix_diagnostic('󰅚', diagnostic) - end - if severity == vim.diagnostic.severity.WARN then - return prefix_diagnostic('⚠', diagnostic) - end - if severity == vim.diagnostic.severity.INFO then - return prefix_diagnostic('ⓘ', diagnostic) - end - if severity == vim.diagnostic.severity.HINT then - return prefix_diagnostic('󰌶', diagnostic) - end - return prefix_diagnostic('■', diagnostic) - end, + current_line = true, }, - update_in_insert = false, underline = true, severity_sort = true, float = { focusable = false, style = 'minimal', - border = 'rounded', source = 'if_many', - header = '', - prefix = '', }, } -- random keymaps -vim.keymap.set('n', 'gq', vim.cmd.bdelete, { noremap = true, silent = true }) -vim.keymap.set('n', 'gQ', '%bd|e#', { noremap = true, silent = true }) +vim.keymap.set({ 'v', 'i', }, 'wq', 'l', { noremap = true, silent = true }) vim.keymap.set('n', '', vim.cmd.bnext, { noremap = true, silent = true }) vim.keymap.set('n', '', vim.cmd.bprev, { noremap = true, silent = true }) -vim.keymap.set({ 'v', 'i' }, 'wq', 'l', { noremap = true, silent = true }) vim.keymap.set('v', "<", "", ">gv") --- clipboard -vim.keymap.set({ 'n', 'v', 'x' }, 'y', '"+y', { noremap = true, silent = true }) -vim.keymap.set('n', 'yy', '"+yy', { noremap = true, silent = true }) -vim.keymap.set({ 'n', 'v', 'x' }, 'p', '"+p', { noremap = true, silent = true }) - -- resize splits if window got resized vim.api.nvim_create_autocmd({ "VimResized" }, { group = vim.api.nvim_create_augroup("resize_splits", { clear = true }), diff --git a/nvim/lua/plugins/ai.lua b/nvim/lua/plugins/ai.lua index 3d88f34..670f55e 100644 --- a/nvim/lua/plugins/ai.lua +++ b/nvim/lua/plugins/ai.lua @@ -2,32 +2,19 @@ return { { "zbirenbaum/copilot.lua", cmd = "Copilot", - keys = { - { - 'M-\\', - 'Copilot panel', - noremap = true, - desc = 'Copilot panel' - } - }, opts = { panel = { enabled = true, - auto_refresh = true, + auto_refresh = false, keymap = { jump_prev = "", jump_next = "", accept = "", + toggle = "" } }, suggestion = { - enabled = true, - auto_trigger = true, - hide_during_completion = true, - keymap = { - accept = "", - next = "", - }, + enabled = false, }, completion = { documentation = { @@ -52,10 +39,12 @@ return { python = true, ruby = true, sh = true, + bash = true, + javascript = true, puppet = true, yaml = true, markdown = true, - ["."] = false, + ["*"] = false, } } }, diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index fda1de5..b0b5d40 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua @@ -1,28 +1,42 @@ return { { 'saghen/blink.cmp', - event = "VeryLazy", + event = 'VeryLazy', dependencies = { - 'rafamadriz/friendly-snippets', - 'mikavilpas/blink-ripgrep.nvim' + 'mikavilpas/blink-ripgrep.nvim', + 'fang2hou/blink-copilot', }, opts = { sources = { default = { - "lsp", - "path", - "snippets", - "buffer", - "ripgrep", + 'lsp', + 'path', + 'omni', + 'ripgrep', + 'copilot', }, providers = { ripgrep = { - module = "blink-ripgrep", - name = "rg", - score_offset = -10, + module = 'blink-ripgrep', + name = 'rg', + score_offset = -30, async = true, }, - } + copilot = { + module = 'blink-copilot', + name = 'Copilot', + score_offset = 100, + async = true, + opts = { + max_completions = 3, + debounce = 500, + auto_refresh = { + backward = false, + forward = true, + } + }, + }, + }, }, cmdline = { completion = { @@ -34,62 +48,22 @@ return { completion = { documentation = { auto_show = true, - auto_show_delay_ms = 100 - }, - list = { - selection = { - preselect = false, - auto_insert = true, - } - }, - ghost_text = { - enabled = true, + auto_show_delay_ms = 500, }, menu = { draw = { - treesitter = { "lsp" }, + treesitter = { 'lsp' }, columns = { - { "label", "label_description", gap = 1 }, - { "source_name", "kind", gap = 1 } + { 'label', 'label_description', gap = 1 }, + { 'source_name', 'kind', gap = 1 }, }, - } + }, }, trigger = { show_on_keyword = true, - } + }, }, - signature = { enabled = true } - } - }, - { - 'L3MON4D3/luasnip', - event = 'VeryLazy', - dependencies = { 'rafamadriz/friendly-snippets' }, - config = function() - local ls = require('luasnip') - ls.config.set_config { - history = true, - updateevents = 'TextChanged, TextChangedI', - } - require('luasnip.loaders.from_vscode').lazy_load() - - vim.keymap.set({ 'i', 's' }, '', function() - if ls.expand_or_jumpable() then - ls.expand_or_jump() - end - end, { silent = true }) - - vim.keymap.set({ 'i', 's' }, '', function() - if ls.jumpable(-1) then - ls.jump(-1) - end - end, { silent = true }) - - vim.keymap.set({ 'i', 's' }, '', function() - if ls.choice_active() then - ls.change_choice(1) - end - end, { silent = true }) - end, + signature = { enabled = true }, + }, }, } diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 070549e..bb164ac 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -29,7 +29,12 @@ return { }, config = function() local lspconfig = require('lspconfig') - local capabilities = require("blink.cmp").get_lsp_capabilities() + local capabilities = vim.tbl_deep_extend( + 'force', + {}, + require("blink.cmp").get_lsp_capabilities(), + vim.lsp.protocol.make_client_capabilities() + ) lspconfig.gopls.setup { capabilities = capabilities, settings = { @@ -94,12 +99,6 @@ return { if not client then return end - vim.keymap.set( - 'n', - 'K', - vim.lsp.buf.hover, - { buffer = ev.buf, noremap = true, silent = true, desc = 'vim.lsp.buf.hover()' } - ) vim.keymap.set( 'n', 'grt', @@ -112,6 +111,12 @@ return { 'Trouble lsp_document_symbols toggle win.position=left ', { buffer = ev.buf, noremap = true, silent = true, desc = 'Trouble LSP symbols' } ) + vim.keymap.set( + 'n', + 'grd', + 'Trouble lsp_definitions toggle win.position=left ', + { buffer = ev.buf, noremap = true, silent = true, desc = 'Trouble LSP definition' } + ) vim.keymap.set( 'n', 'grl', @@ -138,6 +143,9 @@ return { { 'stevearc/conform.nvim', event = 'VeryLazy', + keys = { + { "\\f", function() require("conform").format({}) end, mode = { "n", "x" } }, + }, opts = { notify_no_formatters = false, formatters_by_ft = { @@ -145,7 +153,7 @@ return { puppet = { "puppet-lint" }, ['*'] = { 'trim_whitespace' } }, - format_on_save = { + default_format_opts = { timeout_ms = 500, lsp_format = "last", }, diff --git a/nvim/lua/plugins/misc.lua b/nvim/lua/plugins/misc.lua index c1b786a..935869d 100644 --- a/nvim/lua/plugins/misc.lua +++ b/nvim/lua/plugins/misc.lua @@ -9,7 +9,7 @@ return { event = 'VeryLazy', init = function() vim.api.nvim_set_hl(0, 'EyelinerPrimary', { underline = true }) - vim.api.nvim_set_hl(0, 'EyelinerSecondary', { underline = true }) + vim.api.nvim_set_hl(0, 'EyelinerSecondary', { underline = true, bold = true }) end, }, { 'tiagovla/scope.nvim', event = 'VeryLazy', config = true }, @@ -22,6 +22,12 @@ return { default_args = { DiffviewOpen = { '--imply-local' }, }, + view = { + merge_tool = { + layout = "diff4_mixed", + disable_diagnostics = true, + }, + }, keymaps = { view = { { { "n" }, "q", vim.cmd.DiffviewClose, { desc = "Close Diffview" } }, @@ -38,22 +44,22 @@ return { { 'nb', vim.cmd.DiffviewOpen, noremap = true, desc = 'diffview open' } }, }, - -- { - -- 'NeogitOrg/neogit', - -- opts = { - -- disable_builtin_notifications = true, - -- integrations = { - -- diffview = true, - -- }, - -- }, - -- keys = { - -- { - -- 'ng', - -- function() require('neogit').open() end, - -- { noremap = true, silent = true, desc = 'Neogit' }, - -- }, - -- }, - -- }, + { + 'NeogitOrg/neogit', + opts = { + disable_builtin_notifications = true, + integrations = { + diffview = true, + }, + }, + keys = { + { + 'ng', + function() require('neogit').open() end, + { noremap = true, silent = true, desc = 'Neogit' }, + }, + }, + }, { 'EdenEast/nightfox.nvim', lazy = false, @@ -123,7 +129,6 @@ return { end, }, }, - { '/julienvincent/hunk.nvim', event = 'VeryLazy', opts = {} }, { 'gbprod/yanky.nvim', opts = { diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua index f572c56..56aa37a 100644 --- a/nvim/lua/plugins/snacks.lua +++ b/nvim/lua/plugins/snacks.lua @@ -1,130 +1,145 @@ return { - { - "folke/snacks.nvim", - dependencies = { "folke/trouble.nvim" }, - lazy = false, - priority = 1000, - opts = { - bigfile = { enabled = true }, - dim = { enabled = true }, - quickfile = { enabled = true }, - notifier = { enabled = true }, - scope = { enabled = true }, - terminal = { enabled = true }, - indent = { enabled = true }, - input = { enabled = true }, - words = { enabled = true }, - picker = { - enabled = true, - matcher = { frecency = true }, - layout = { - preset = function() - return vim.o.columns >= 120 and "telescope" or "vertical" - end + { + "folke/snacks.nvim", + dependencies = { "folke/trouble.nvim" }, + lazy = false, + priority = 1000, + opts = { + bigfile = { enabled = true }, + bufdelete = { enabled = true }, + dim = { enabled = true }, + quickfile = { enabled = true }, + notifier = { enabled = true }, + scope = { enabled = true }, + terminal = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + words = { enabled = true }, + picker = { + enabled = true, + matcher = { frecency = true }, + layout = { + preset = function() + return vim.o.columns >= 120 and "telescope" or "vertical" + end + }, + sources = { + files = { hidden = true }, + grep = { hidden = true }, + explorer = { hidden = true }, + git_files = { untracked = true }, + smart = { + multi = { "buffers", "recent", "files", "git_files" } + } + }, + actions = { + trouble_open = function(...) + return require("trouble.sources.snacks").actions.trouble_open.action(...) + end, + }, + win = { + input = { + keys = { + ["wq"] = { "close", mode = "i" }, + [""] = { "trouble_open", mode = { "n", "i" } }, + } + }, + list = { + keys = { + ["wq"] = { "close", mode = "i" }, + } + } + } + }, }, - sources = { - files = { hidden = true }, - grep = { hidden = true }, - explorer = { hidden = true }, - git_files = { untracked = true }, - smart = { - multi = { "buffers", "recent", "files", "git_files" } - } - }, - actions = { - trouble_open = function(...) - return require("trouble.sources.snacks").actions.trouble_open.action(...) - end, - }, - win = { - input = { - keys = { - ["wq"] = { "close", mode = "i" }, - [""] = { "trouble_open", mode = { "n", "i" } }, - } - }, - list = { - keys = { - ["wq"] = { "close", mode = "i" }, - } - } + config = function(_, opts) + require("snacks").setup(opts) + vim.api.nvim_set_hl(0, 'SnacksPickerDir', { fg = '#cccccc' }) + end, + keys = { + { '', function() Snacks.terminal.toggle() end, mode = { "n", "t" }, noremap = true, desc = 'terminal open' }, + { '', function() Snacks.terminal.toggle('$SHELL') end, mode = { "n", "t" }, noremap = true, desc = 'terminal open' }, + { 'm', function() Snacks.words.jump(1, true) end, noremap = true, desc = 'next reference' }, + { 'M', function() Snacks.words.jump(-1, true) end, noremap = true, desc = 'next reference' }, + { + '\\z', + function() + if Snacks.dim.enabled then + Snacks.dim.disable() + else + Snacks.dim.enable() + end + end, + noremap = true, + desc = 'next reference' + }, + { 'gq', function() Snacks.bufdelete() end, noremap = true, silent = true }, + { 'gQ', function() Snacks.bufdelete.other() end, noremap = true, silent = true }, + { + 'ff', + function() Snacks.picker.smart() end, + { noremap = true, silent = true, desc = 'Fuzzy find files' } + }, + { + 'fe', + function() Snacks.explorer() end, + { noremap = true, silent = true, desc = 'snacks explorer' } + }, + { + 'fE', + function() Snacks.explorer.reveal() end, + { noremap = true, silent = true, desc = 'snacks explorer open current file' } + }, + { + 'fg', + function() Snacks.picker.git_files() end, + { noremap = true, silent = true, desc = 'Fuzzy find files' } + }, + { + 'fa', + function() Snacks.picker.grep() end, + { noremap = true, silent = true, desc = 'Fuzzy find grep' } + }, + { + 'f8', + function() Snacks.picker.grep_word() end, + { noremap = true, silent = true, desc = 'Fuzzy find grep word' } + }, + { + 'f?', + function() Snacks.picker.pickers() end, + { noremap = true, silent = true, desc = 'See all pickers' } + }, + { + 'f\'', + function() Snacks.picker.marks() end, + { noremap = true, silent = true, desc = 'Pick marks' } + }, + { + 'fu', + function() Snacks.picker.undo() end, + { noremap = true, silent = true, desc = 'Pick undotree' } + }, + { + 'fj', + function() Snacks.picker.jumps() end, + { noremap = true, silent = true, desc = 'Pick jumps' } + }, + { + 'f.', + function() Snacks.picker.resume() end, + { noremap = true, silent = true, desc = 'Fuzzy find resume' } + }, + { + '', + function() Snacks.picker.buffers() end, + { noremap = true, silent = true, desc = 'Fuzzy find buffers' } + }, + { + 'fn', + function() Snacks.picker.notifications() end, + { noremap = true, silent = true, desc = 'pick notifications' } + }, } - }, - }, - config = function(_, opts) - require("snacks").setup(opts) - vim.api.nvim_set_hl(0, 'SnacksPickerDir', { fg = '#cccccc' }) - end, - keys = { - { '', function() Snacks.terminal.toggle() end, mode = { "n", "t" }, noremap = true, desc = 'terminal open' }, - { '\\\\', function() Snacks.terminal.toggle('$SHELL') end, mode = { "n", "t" }, noremap = true, desc = 'terminal open' }, - { 'm', function() Snacks.words.jump(1, true) end, noremap = true, desc = 'next reference' }, - { 'M', function() Snacks.words.jump(-1, true) end, noremap = true, desc = 'next reference' }, - { - 'ff', - function() Snacks.picker.smart() end, - { noremap = true, silent = true, desc = 'Fuzzy find files' } - }, - { - 'fe', - function() Snacks.explorer() end, - { noremap = true, silent = true, desc = 'snacks explorer' } - }, - { - 'fE', - function() Snacks.explorer.reveal() end, - { noremap = true, silent = true, desc = 'snacks explorer open current file' } - }, - { - 'fg', - function() Snacks.picker.git_files() end, - { noremap = true, silent = true, desc = 'Fuzzy find files' } - }, - { - 'fa', - function() Snacks.picker.grep() end, - { noremap = true, silent = true, desc = 'Fuzzy find grep' } - }, - { - 'f8', - function() Snacks.picker.grep_word() end, - { noremap = true, silent = true, desc = 'Fuzzy find grep word' } - }, - { - 'f?', - function() Snacks.picker.pickers() end, - { noremap = true, silent = true, desc = 'See all pickers' } - }, - { - 'f\'', - function() Snacks.picker.marks() end, - { noremap = true, silent = true, desc = 'Pick marks' } - }, - { - 'fu', - function() Snacks.picker.undo() end, - { noremap = true, silent = true, desc = 'Pick undotree' } - }, - { - 'fj', - function() Snacks.picker.jumps() end, - { noremap = true, silent = true, desc = 'Pick jumps' } - }, - { - 'f.', - function() Snacks.picker.resume() end, - { noremap = true, silent = true, desc = 'Fuzzy find resume' } - }, - { - '', - function() Snacks.picker.buffers() end, - { noremap = true, silent = true, desc = 'Fuzzy find buffers' } - }, - { - 'fn', - function() Snacks.picker.notifications() end, - { noremap = true, silent = true, desc = 'pick notifications' } - }, } - } }