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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top