gpt4 book ai didi

vim - Vim中如何在两个文件之间跳转

转载 作者:行者123 更新时间:2023-12-02 17:33:13 25 4
gpt4 key购买 nike

我需要在 Vim 中的两个文件之间来回跳转。

我可以手动执行此操作::e file1.txt 后跟 :e file2.txt。有没有直接跳转到之前打开的文件的快捷方式?

注意:我不想在拆分窗口或多个选项卡中打开这两个文件。

我正在寻找类似[ctrl + o]的内容,只有跳转应该是到上一个文件,而不是同一文件中的上一个位置

感谢您的任何提示

最佳答案

使用<C-^><C-6>

来自 :h ctrl-^ :

Edit the alternate file. Mostly the alternate file is
the previously edited file. This is a quick way to
toggle between two files. It is equivalent to ":e #",
except that it also works when there is no file name.

If the 'autowrite' or 'autowriteall' option is on and
the buffer was changed, write it.
Mostly the ^ character is positioned on the 6 key,
pressing CTRL and 6 then gets you what we call CTRL-^.
But on some non-US keyboards CTRL-^ is produced in
another way.

关于vim - Vim中如何在两个文件之间跳转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17041584/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com