如何跳转到Vim中最后一个更改点

如何跳转到Vim中最后一个更改点,vim,Vim,。可以跳转到最后一次更改的行。但是我需要跳到确切的点。使用`。。也就是说,反勾号后跟一个点。由于更改有开始和结束,`[和`也非常有用: '[ `[ To the first character of the previously changed or yanked text. '] `] To the last character of the previously chan

可以跳转到最后一次更改的行。但是我需要跳到确切的点。

使用
`。
。也就是说,反勾号后跟一个点。

由于更改有开始和结束,
`[
`
也非常有用:

'[  `[                  To the first character of the previously changed
                        or yanked text.

']  `]                  To the last character of the previously changed or
                        yanked text.

After executing an operator the Cursor is put at the beginning of the text
that was operated upon.  After a put command ("p" or "P") the cursor is
sometimes placed at the first inserted line and sometimes on the last inserted
character.  The four commands above put the cursor at either end.  Example:
After yanking 10 lines you want to go to the last one of them: "10Y']".  After
inserting several lines with the "p" command you want to jump to the lowest
inserted line: "p']".  This also works for text that has been inserted.

我建议映射到最后一个更改点,如下所示:

gv ................... repeats last selection
gi ................... enters insert at the last inserting point

" gl to jump to the last change "exactly"
nnoremap gl `.        

参考:

若要跳到上一版本“插入”的确切位置,请尝试
gi
若要跳到上次插入模式停止时光标所在的位置,请使用
`^
。使用
gi
在该位置启动插入模式。请注意,
“^i
gi
不完全相同(请参见
:help gi
)。