When using vim-fugitive, the :Git add -p command drops into a diff terminal. This diff view shows paths that are relative to the root of the git repository but I'm frequently cd'ed somewhere else, which causes gf to fail. To make sure gf always works in this case, I added a root directory that points to the git repository root, using b:vim_gf_diff_base_directory. It works for me but I made this PR in case you find it useful
When using vim-fugitive, the
:Git add -p
command drops into a diff terminal. This diff view shows paths that are relative to the root of the git repository but I'm frequently cd'ed somewhere else, which causesgf
to fail. To make suregf
always works in this case, I added a root directory that points to the git repository root, usingb:vim_gf_diff_base_directory
. It works for me but I made this PR in case you find it useful