diff options
Diffstat (limited to 'pkgs/custom-neovim/config/lua/keymaps.lua')
| -rw-r--r-- | pkgs/custom-neovim/config/lua/keymaps.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/custom-neovim/config/lua/keymaps.lua b/pkgs/custom-neovim/config/lua/keymaps.lua index e3502fe..fc927b0 100644 --- a/pkgs/custom-neovim/config/lua/keymaps.lua +++ b/pkgs/custom-neovim/config/lua/keymaps.lua @@ -17,6 +17,23 @@ 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 () + 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.tcd(choice) + end + ) +end, "mini.pick") -- File manager mapkey("n", "<leader>e", "Open file manager", ":lua MiniFiles.open()<cr>", "mini.files") |
