From 8bf037c0015e076dee898d99b7bf75a0e7276e5a Mon Sep 17 00:00:00 2001 From: triethyl Date: Mon, 16 Mar 2026 22:02:17 -0400 Subject: neovim: preliminarily replaced fzf-lua with mini.pick --- pkgs/custom-neovim/.luarc.json | 2 +- pkgs/custom-neovim/config/lua/keymaps.lua | 29 +++++++++-------- pkgs/custom-neovim/config/lua/lsp.lua | 10 +++--- pkgs/custom-neovim/config/lua/plugins/fzf.lua | 1 + .../custom-neovim/config/lua/plugins/mini-pick.lua | 38 +++++++++++++--------- pkgs/custom-neovim/default.nix | 2 ++ 6 files changed, 46 insertions(+), 36 deletions(-) diff --git a/pkgs/custom-neovim/.luarc.json b/pkgs/custom-neovim/.luarc.json index 89999a9..ae02006 100644 --- a/pkgs/custom-neovim/.luarc.json +++ b/pkgs/custom-neovim/.luarc.json @@ -15,7 +15,7 @@ ] }, "diagnostics": { - "globals": ["vim"] + "globals": ["vim", "MiniFiles", "MiniPick"] }, "telemetry": { "enable": false diff --git a/pkgs/custom-neovim/config/lua/keymaps.lua b/pkgs/custom-neovim/config/lua/keymaps.lua index 535962d..67d61cf 100644 --- a/pkgs/custom-neovim/config/lua/keymaps.lua +++ b/pkgs/custom-neovim/config/lua/keymaps.lua @@ -12,13 +12,14 @@ end vim.g.mapleader = " " -- Pickers -mapkey("n", "f", "Open file picker", ":FzfLua files", "fzf-lua") -mapkey("n", "o", "Open old file picker", ":FzfLua oldfiles", "fzf-lua") -mapkey("n", "/", "Open live grep picker", ":FzfLua live_grep", "fzf-lua") -mapkey("n", "k", "Open colorscheme picker", ":FzfLua colorschemes", "fzf-lua") -mapkey("n", "z", "Open zoxide picker", ":FzfLua zoxide", "fzf-lua") -mapkey("n", "L", "Open cd picker", ":lua Custom_pickers.fzf_dir_cd()", "fzf-lua") -mapkey("n", "l", "Open tab cd picker", ":lua Custom_pickers.fzf_dir_tcd()", "fzf-lua") +mapkey("n", "f", "Open file picker", ":Pick files", "mini.pick") +mapkey("n", "o", "Open old file picker", ":Pick oldfiles", "mini.pick") +mapkey("n", "/", "Open live grep picker", ":Pick grep_live", "mini.pick") +mapkey("n", "k", "Open colorscheme picker", ":Pick colorschemes", "mini.pick") +mapkey("n", ":", "Open command history picker", ":Pick history", "mini.pick") +-- mapkey("n", "z", "Open zoxide picker", ":FzfLua zoxide", "fzf-lua") +-- mapkey("n", "L", "Open cd picker", ":lua Custom_pickers.fzf_dir_cd()", "fzf-lua") +-- mapkey("n", "l", "Open tab cd picker", ":lua Custom_pickers.fzf_dir_tcd()", "fzf-lua") -- File manager mapkey("n", "e", "Open file manager", ":lua MiniFiles.open()", "mini.files") @@ -29,10 +30,10 @@ mapkey("n", "ga", "Git add", ":Git add %:p", "mini-git") mapkey("n", "gA", "Git add cwd", function() vim.cmd("Git add " .. vim.fn.getcwd() .. "/.") end, "mini-git") mapkey("n", "gr", "Git remove", ":Git rm %:p", "mini-git") mapkey("n", "gc", "Git commit", ":Git commit", "mini-git") -mapkey("n", "gC", "Browse git commits", ":FzfLua git_commits", "fzf-lua") -mapkey("n", "gb", "Browse git branches", ":FzfLua git_branches", "fzf-lua") -mapkey("n", "gB", "Browse git blame", ":FzfLua git_blame", "fzf-lua") -mapkey("n", "gg", "Git status", ":FzfLua git_status", "fzf-lua") +mapkey("n", "gC", "Browse git commits", ":Pick git_commits", "mini.pick") +mapkey("n", "gb", "Browse git branches", ":Pick git_branches", "mini.pick") +-- mapkey("n", "gB", "Browse git blame", ":FzfLua git_blame", "fzf-lua") +-- mapkey("n", "gg", "Git status", ":FzfLua git_status", "fzf-lua") mapkey("n", "gp", "Git pull", ":Git pull", "mini-git") mapkey("n", "gP", "Git push", ":Git push", "mini-git") @@ -42,11 +43,11 @@ mapkey("n", "tt", "Go to next tab", ":tabn") mapkey("n", "tT", "Go to previous tab", ":tabp") mapkey("n", "to", "Open new tab", ":tabnew") mapkey("n", "tc", "Close current tab", ":tabclose") -mapkey("n", "tp", "Pick tabs", ":FzfLua tabs", "fzf-lua") +-- mapkey("n", "tp", "Pick tabs", ":FzfLua tabs", "fzf-lua") -- Buffers mapkey("n", "b", "Manage buffers", "") -mapkey("n", "bb", "Open buffer picker", ":FzfLua buffers", "fzf-lua") +mapkey("n", "bb", "Open buffer picker", ":Pick buffers", "mini.pick") mapkey("n", "bc", "Clear invisible buffers", function () local bufinfos = vim.fn.getbufinfo({buflisted = 1}) vim.tbl_map(function (bufinfo) @@ -63,7 +64,7 @@ mapkey("n", "jb", "Create comment box", ":CB") -- Session mapkey("n", "w", "Manage sessions", "") -mapkey("n", "ww", "Manage Sessions", ":AutoSession search", "fzf-lua") +mapkey("n", "ww", "Manage Sessions", ":AutoSession search", "mini.pick") mapkey("n", "ws", "Save current session", ":AutoSession save") mapkey("n", "wr", "Open last session", ":AutoSession restore") mapkey("n", "wp", "Purge orphaned sessions", ":AutoSession purgeOrphaned") diff --git a/pkgs/custom-neovim/config/lua/lsp.lua b/pkgs/custom-neovim/config/lua/lsp.lua index 0b3627e..f4e47df 100644 --- a/pkgs/custom-neovim/config/lua/lsp.lua +++ b/pkgs/custom-neovim/config/lua/lsp.lua @@ -72,11 +72,11 @@ vim.api.nvim_create_autocmd('LspAttach', { end -- LSP Pickers - mapkey('n', "a", "Perform code action", ":FzfLua lsp_code_actions", "fzf-lua") - mapkey("n", "S", "Open workspace symbol picker", ":FzfLua lsp_workspace_symbols", "fzf-lua") - mapkey("n", "s", "Open symbol picker", ":FzfLua lsp_document_symbols", "fzf-lua") - mapkey("n", "I", "Open workspace diagnostic picker", ":FzfLua lsp_workspace_diagnostics", "fzf-lua") - mapkey("n", "i", "Open diagnostic picker", ":FzfLua lsp_document_diagnostics", "fzf-lua") + -- mapkey('n', "a", "Perform code action", ":FzfLua lsp_code_actions", "fzf-lua") + mapkey("n", "S", "Open workspace symbol picker", ":lua MiniExtra.pickers.lsp({ scope = 'workspace_symbol' })", "mini.pick") + mapkey("n", "s", "Open symbol picker", ":lua MiniExtra.pickers.lsp({ scope = 'document_symbol' })", "mini.pick") + mapkey("n", "I", "Open workspace diagnostic picker", ":lua MiniExtra.pickers.diagnostic({ scope = 'all' })", "mini.pick") + mapkey("n", "i", "Open diagnostic picker", ":lua MiniExtra.pickers.diagnostic({ scope = 'current' })", "mini.pick") -- Goto Keys mapkey('n', 'gD', "Go to declaration", vim.lsp.buf.declaration) diff --git a/pkgs/custom-neovim/config/lua/plugins/fzf.lua b/pkgs/custom-neovim/config/lua/plugins/fzf.lua index e8987a9..984a2ca 100644 --- a/pkgs/custom-neovim/config/lua/plugins/fzf.lua +++ b/pkgs/custom-neovim/config/lua/plugins/fzf.lua @@ -1,5 +1,6 @@ return { "fzf-lua", + enabled = false, cmd = "FzfLua", after = function () require("fzf-lua").setup { diff --git a/pkgs/custom-neovim/config/lua/plugins/mini-pick.lua b/pkgs/custom-neovim/config/lua/plugins/mini-pick.lua index b391136..68e57ec 100644 --- a/pkgs/custom-neovim/config/lua/plugins/mini-pick.lua +++ b/pkgs/custom-neovim/config/lua/plugins/mini-pick.lua @@ -1,19 +1,25 @@ return { - { - "mini.pick", - lazy = false, - before = function () - vim.cmd.packadd("mini.extra") - end, - after = function () - require("mini.pick").setup() + "mini.pick", + lazy = true, + cmd = "Pick", + after = function() + local win_config = function() + local height = math.floor(0.618 * vim.o.lines) + local width = math.floor(0.618 * vim.o.columns) + return { + anchor = 'NW', height = height, width = width, + row = math.floor(0.5 * (vim.o.lines - height)), + col = math.floor(0.5 * (vim.o.columns - width)), + } end - }, - { - "mini.extra", - lazy = false, - after = function () - require("mini.extra").setup() - end - } + require("mini.pick").setup { + window = { + config = win_config, + }, + } + vim.cmd.packadd("mini.extra") + require("mini.extra").setup() + + vim.ui.select = MiniPick.ui_select + end } diff --git a/pkgs/custom-neovim/default.nix b/pkgs/custom-neovim/default.nix index 132a34f..5fd6050 100644 --- a/pkgs/custom-neovim/default.nix +++ b/pkgs/custom-neovim/default.nix @@ -30,6 +30,8 @@ in # UI Plugins nvim-treesitter.withAllGrammars # All treesitter grammars fzf-lua + mini-pick + mini-extra mini-clue mini-files mini-icons -- cgit v1.2.3