gpt4 book ai didi

vim - 如何在 Vim 中返回到上一个打开的文件?

转载 作者:行者123 更新时间:2023-12-03 04:36:46 26 4
gpt4 key购买 nike

我可以使用gf要转到光标下/光标后的名称文件,是否有任何命令可以返回到原始文件而无需重新启动 vim 来打开它?

最佳答案

尝试使用此快捷方式:

CTRL-^

Vim 文档 :help CTRL-^:

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 there already was a current file name, then that one becomes the alternate file name. It can be used with "#" on the command line |:_#| and you can use the |CTRL-^| command to toggle between the current and the alternate file. However, the alternate file name is not changed when |:keepalt| is used. An alternate file name is remembered for each window.

关于vim - 如何在 Vim 中返回到上一个打开的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19971023/

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