From 0a7aa13d9e8a0e526353c6538d8cf2d365ade86b Mon Sep 17 00:00:00 2001 From: triethyl Date: Wed, 5 Nov 2025 20:38:53 -0500 Subject: neovim: lots of new mini plugins and configs --- pkgs/custom-neovim/config/lua/keymaps.lua | 63 +++++-------------------------- 1 file changed, 10 insertions(+), 53 deletions(-) (limited to 'pkgs/custom-neovim/config/lua/keymaps.lua') diff --git a/pkgs/custom-neovim/config/lua/keymaps.lua b/pkgs/custom-neovim/config/lua/keymaps.lua index 86632ee..9c1d260 100644 --- a/pkgs/custom-neovim/config/lua/keymaps.lua +++ b/pkgs/custom-neovim/config/lua/keymaps.lua @@ -17,40 +17,8 @@ mapkey("n", "o", "Open old file picker", ":FzfLua oldfiles", "fzf-lu 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 tab 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, "fzf-lua") -mapkey("n", "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, "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") @@ -61,7 +29,7 @@ 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", "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") @@ -94,25 +62,14 @@ mapkey("n", "j", "Manage comment graphics", "") mapkey("n", "jb", "Create comment box", ":CB") -- Session --- mapkey("n", "w", "Manage sessions", "") --- mapkey("n", "ww", "Open a session", ":AutoSession search", "mini.pick") --- mapkey("n", "wd", "Delete a session", ":AutoSession deletePicker", "mini.pick") --- mapkey("n", "wD", "Delete current session", ":AutoSession delete", "mini.pick") --- mapkey("n", "wr", "Restore last session", ":AutoSession restore") --- mapkey("n", "wp", "Purge orphaned sessions", ":AutoSession purgeOrphaned") --- mapkey("n", "ws", "Save session", ":AutoSession save") - -mapkey("n", "w", "Manage sessions", "", "mini.sessions") -mapkey("n", "ww", "Open a session", ":lua MiniSessions.select('read')", "fzf-lua") -mapkey("n", "wd", "Delete a session", ":lua MiniSessions.select('delete')", "fzf-lua") -mapkey("n", "ws", "Save current session", ":lua MiniSessions.write()") -mapkey("n", "wS", "Save as new session", function() - local session_name = vim.fn.input("Session name: ") - vim.cmd.lua("MiniSessions.write("..session_name..")") -end) -mapkey("n", "wn", "Create new session", function() +mapkey("n", "w", "Manage sessions", "") +mapkey("n", "ww", "Manage Sessions", ":AutoSession search", "fzf-lua") +mapkey("n", "ws", "Save current session", ":AutoSession save") +mapkey("n", "wr", "Open last session", ":AutoSession restore") +mapkey("n", "wp", "Purge orphaned sessions", ":AutoSession purgeOrphaned") +mapkey("n", "wl", "Leave current session", function() vim.cmd.wa() - vim.cmd.lua("MiniSessions.write()") + vim.cmd("AutoSession save") vim.cmd.new() vim.cmd([[.+,$bwipeout]]) vim.cmd.cd("~") -- cgit v1.2.3