I have a huge file where I modified several lines, and saved it. The fugitive knows which lines are modified, and it would be very useful to just jump between them. Is there an existing hotkey for that, or can I map it somehow?
If you mean you've done a :Gdiff
to another revision or the index, you can use the built-in ]c
and [c
motions to jump to the next / previous start of a change, as Vim shows the changes in 'diff'
mode.
Edit: Have a look at the gitgutter plugin; it shows the changes in the sign column, updates those automatically, and even overloads the mentioned ]c
commands as you would like them to behave.
Even without fugitive, vim maintains a changelist for every document which you can see by invoking :changes
. You can jump through the changelist using g;
(go to older change), g,
(go to newer change).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With