Pregunta

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?

¿Fue útil?

Solución

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.

Otros consejos

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).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top