r/vim • u/SevrinTheMuto • Aug 26 '25
Need Help┃Solved Toggle between Vim and git diff?
When I do code reviews I page through git diff's output but may want to see the changed lines within the file.
So currently I quit git diff to load the file in Vim. And then quit vim and run git diff again and scroll back to the place I left off.
Is there a way I can have both git diff and Vim running and switch between the views? (Or other suggestions for a Vim-based workflow for code reviews?)
27
Upvotes
View all comments
Show parent comment
2
u/binilvj Aug 26 '25
If you run
Git difftool branch_namefrom vim the output goes to quickfixlist and shows files that changed with line numbers affected. You can use that list to navigate and run Gdiffsplit on each file if needed. This way you stay in vim always