diff options
| author | triethyl <triethylammonium@pm.me> | 2025-10-16 08:48:10 -0400 |
|---|---|---|
| committer | triethyl <triethylammonium@pm.me> | 2025-10-16 08:48:10 -0400 |
| commit | 912a77d5df6b42a19ececac04aadac883a4e939e (patch) | |
| tree | f89da3857aa41b0f024f06bbd0987474c579b093 /pkgs | |
| parent | 8daa85343baba3e8532acef44fb80ff05bb7c933 (diff) | |
neovim: added full dir change picker
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/custom-neovim/config/lua/keymaps.lua | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/pkgs/custom-neovim/config/lua/keymaps.lua b/pkgs/custom-neovim/config/lua/keymaps.lua index fc927b0..95fce51 100644 --- a/pkgs/custom-neovim/config/lua/keymaps.lua +++ b/pkgs/custom-neovim/config/lua/keymaps.lua @@ -17,7 +17,7 @@ mapkey("n", "<leader>o", "Open old file picker", ":Pick oldfiles<cr>", "mini.pic mapkey("n", "<leader>/", "Open live grep picker", ":Pick grep_live<cr>", "mini.pick") mapkey("n", "<leader>k", "Open colorscheme picker", ":Pick colorschemes<cr>", "mini.pick") mapkey("n", "<leader>z", "Open zoxide picker", ":Zi<cr>", "zoxide.vim") -mapkey("n", "<leader>l", "Open directory picker", function () +mapkey("n", "<leader>l", "Open tab directory picker", function () local dirstr = vim.fn.system("fd -t d") local pos,dirtbl = 0,{} @@ -34,6 +34,23 @@ mapkey("n", "<leader>l", "Open directory picker", function () end ) end, "mini.pick") +mapkey("n", "<leader>L", "Open directory picker", function () + local dirstr = vim.fn.system("fd -t d") + + local pos,dirtbl = 0,{} + for st,sp in function() return string.find(dirstr, "\n", pos, true) end do + table.insert(dirtbl, string.sub(dirstr, pos, st - 1)) + pos = sp + 1 + end + table.insert(dirtbl, string.sub(dirstr, pos)) + vim.ui.select( + dirtbl, + {}, + function (choice) + vim.cmd.cd(choice) + end + ) +end, "mini.pick") -- File manager mapkey("n", "<leader>e", "Open file manager", ":lua MiniFiles.open()<cr>", "mini.files") |
