diff options
| author | triethyl <triethylammonium@pm.me> | 2025-11-05 20:38:53 -0500 |
|---|---|---|
| committer | triethyl <triethylammonium@pm.me> | 2025-11-05 20:38:53 -0500 |
| commit | 0a7aa13d9e8a0e526353c6538d8cf2d365ade86b (patch) | |
| tree | a320387bd5bd408f863ffc476e5ab18b90b175a0 /pkgs/custom-neovim/config/lua/keymaps.lua | |
| parent | 56b150edeacbe30f1e19e5a7df03499c5dced06d (diff) | |
neovim: lots of new mini plugins and configs
Diffstat (limited to 'pkgs/custom-neovim/config/lua/keymaps.lua')
| -rw-r--r-- | pkgs/custom-neovim/config/lua/keymaps.lua | 63 |
1 files changed, 10 insertions, 53 deletions
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", "<leader>o", "Open old file picker", ":FzfLua oldfiles<cr>", "fzf-lu mapkey("n", "<leader>/", "Open live grep picker", ":FzfLua live_grep<cr>", "fzf-lua") mapkey("n", "<leader>k", "Open colorscheme picker", ":FzfLua colorschemes<cr>", "fzf-lua") mapkey("n", "<leader>z", "Open zoxide picker", ":FzfLua zoxide<cr>", "fzf-lua") -mapkey("n", "<leader>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", "<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, "fzf-lua") +mapkey("n", "<leader>L", "Open cd picker", ":lua Custom_pickers.fzf_dir_cd()<cr>", "fzf-lua") +mapkey("n", "<leader>l", "Open tab cd picker", ":lua Custom_pickers.fzf_dir_tcd()<cr>", "fzf-lua") -- File manager mapkey("n", "<leader>e", "Open file manager", ":lua MiniFiles.open()<cr>", "mini.files") @@ -61,7 +29,7 @@ mapkey("n", "<leader>ga", "Git add", ":Git add %:p<cr>", "mini-git") mapkey("n", "<leader>gA", "Git add cwd", function() vim.cmd("Git add " .. vim.fn.getcwd() .. "/.") end, "mini-git") mapkey("n", "<leader>gr", "Git remove", ":Git rm %:p<cr>", "mini-git") mapkey("n", "<leader>gc", "Git commit", ":Git commit<cr>", "mini-git") -mapkey("n", "<leader>gc", "Browse git commits", ":FzfLua git_commits<cr>", "fzf-lua") +mapkey("n", "<leader>gC", "Browse git commits", ":FzfLua git_commits<cr>", "fzf-lua") mapkey("n", "<leader>gb", "Browse git branches", ":FzfLua git_branches<cr>", "fzf-lua") mapkey("n", "<leader>gB", "Browse git blame", ":FzfLua git_blame<cr>", "fzf-lua") mapkey("n", "<leader>gg", "Git status", ":FzfLua git_status<cr>", "fzf-lua") @@ -94,25 +62,14 @@ mapkey("n", "<leader>j", "Manage comment graphics", "") mapkey("n", "<leader>jb", "Create comment box", ":CB") -- Session --- mapkey("n", "<leader>w", "Manage sessions", "") --- mapkey("n", "<leader>ww", "Open a session", ":AutoSession search<cr>", "mini.pick") --- mapkey("n", "<leader>wd", "Delete a session", ":AutoSession deletePicker<cr>", "mini.pick") --- mapkey("n", "<leader>wD", "Delete current session", ":AutoSession delete<cr>", "mini.pick") --- mapkey("n", "<leader>wr", "Restore last session", ":AutoSession restore<cr>") --- mapkey("n", "<leader>wp", "Purge orphaned sessions", ":AutoSession purgeOrphaned<cr>") --- mapkey("n", "<leader>ws", "Save session", ":AutoSession save<cr>") - -mapkey("n", "<leader>w", "Manage sessions", "", "mini.sessions") -mapkey("n", "<leader>ww", "Open a session", ":lua MiniSessions.select('read')<cr>", "fzf-lua") -mapkey("n", "<leader>wd", "Delete a session", ":lua MiniSessions.select('delete')<cr>", "fzf-lua") -mapkey("n", "<leader>ws", "Save current session", ":lua MiniSessions.write()<cr>") -mapkey("n", "<leader>wS", "Save as new session", function() - local session_name = vim.fn.input("Session name: ") - vim.cmd.lua("MiniSessions.write("..session_name..")") -end) -mapkey("n", "<leader>wn", "Create new session", function() +mapkey("n", "<leader>w", "Manage sessions", "") +mapkey("n", "<leader>ww", "Manage Sessions", ":AutoSession search<cr>", "fzf-lua") +mapkey("n", "<leader>ws", "Save current session", ":AutoSession save<cr>") +mapkey("n", "<leader>wr", "Open last session", ":AutoSession restore<cr>") +mapkey("n", "<leader>wp", "Purge orphaned sessions", ":AutoSession purgeOrphaned<cr>") +mapkey("n", "<leader>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("~") |
