From 4ee6be4499008db458089fb2573b13f6b5ec5d3b Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Fri, 1 Nov 2024 23:47:03 +0200 Subject: [PATCH] fix(lazygit): file history when cwd is outside the repo (#4666) ## Description When using `gf` Lazygit is launched in the current directory rather than the root directory. ## Related Issue(s) ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/config/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 84bba42c..cc226964 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -137,7 +137,7 @@ map("n", "gB", LazyVim.lazygit.browse, { desc = "Git Browse" }) map("n", "gf", function() local git_path = vim.api.nvim_buf_get_name(0) - LazyVim.lazygit({args = { "-f", vim.trim(git_path) }}) + LazyVim.lazygit({args = { "-f", vim.trim(git_path) }, cwd = LazyVim.root.git()}) end, { desc = "Lazygit Current File History" }) map("n", "gl", function()