mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-24 20:54:48 +02:00
feat(git): add <leader>gf for lazygit commit history on current file (#2728)
* Add <leader>gf for lazygit commit history on current file * Change root dir to git root using git command * refactor: cleanup --------- Co-authored-by: Uthman Mohamed <83053931+1239uth@users.noreply.github.com> Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This commit is contained in:
parent
cca2e09149
commit
0ec7a9040b
1 changed files with 5 additions and 0 deletions
|
@ -129,6 +129,11 @@ map("n", "<leader>ub", function() Util.toggle("background", false, {"light", "da
|
|||
map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
|
||||
map("n", "<leader>gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
|
||||
|
||||
map("n", "<leader>gf", function()
|
||||
local git_path = vim.fn.system("git ls-files --full-name " .. vim.api.nvim_buf_get_name(0))
|
||||
Util.terminal({ "lazygit", "-f", vim.trim(git_path) }, { esc_esc = false, ctrl_hjkl = false })
|
||||
end, { desc = "Lazygit current file history" })
|
||||
|
||||
-- quit
|
||||
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue