如何在 Vim 中准确跳转到最后一个变化点

发布于 2024-12-09 07:48:05 字数 45 浏览 0 评论 0原文

'.可以跳转到最后更改的行。但我需要跳到确切的点。

'. can jump to the line of last change. But I need to jump to the exactly point.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

廻憶裏菂餘溫 2024-12-16 07:48:05

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

Use `.. That is, backtick followed by a dot.

漫雪独思 2024-12-16 07:48:05

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

'[  `[                  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.

As a change has a beginning and an end, `[ and `] are also very helpful:

'[  `[                  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.
暖树树初阳… 2024-12-16 07:48:05

答案有点旧,但供当前参考:

:changes 显示更改列表
g; 跳转到上次编辑
最后一次编辑中向前跳转

g,vimtricks 中找到的

answers are kinda old, but for current reference:

:changes show a list of changes
g; jump to last edit
g, jump forward in last edit's

found at vimtricks

独夜无伴 2024-12-16 07:48:05

我建议使用映射来跳转到最后一个变化点,如下所示:

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

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

参考:https://twitter. com/dotvimrc/status/191163723065462786

I suggest a mapping to jump to the last changing point, as we have:

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

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

Reference: https://twitter.com/dotvimrc/status/191163723065462786

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文