0

我经常发现自己在 Vim 的Conque shell 中导航文件系统,并想在现有的 MacVim 会话中打开特定文件。这可能吗 ?- 我希望得到类似的东西:

shell> open some/file.txt

然后在我现有的 Vim 窗口中弹出 file.txt(最好在新选项卡中)。

注意:我正在使用@wycats vim点文件(不确定这是否重要)。

4

3 回答 3

1

Type from ConqueShell

mvim --remote-tab-silent filename

This will open the file in a new tab in MacVim

You could also write a Bash alias to shorten the command (assuming you are using bash). Put in your ~/.profile

alias vim='mvim --remote-tab-silent'

this would enable you to type

vim filename

from ConqueShell or bash, and have it open in a new MacVim tab, rather than terminal vim. It of course does disable your ability to run standard vim (although you could still use the vi command), so maybe you would want to name the alias differently.

Just to add, this will work only if you placed the mvim executable on your path E.G. /usr/bin/mvim. It comes with the MacVim.app

于 2010-12-31T11:52:45.540 回答
1

我经常发现自己在 Conque shell 中导航文件系统

从 vim 内部运行 shell 的美妙之处在于您可以使用所有的 vim 和 shell。

gf是你的朋友。一旦你以某种方式获得了你想要在屏幕上显示的文件,你就可以进入普通模式,将光标移动到你想要编辑的文件上,然后使用gf命令导航到该文件。有很多方法可以使用它。任何输出文件名的程序或命令都非常适合(ll、git status 等)。您还可以在 shell 中键入文件名,只是为了使其在屏幕上可见,而无需实际运行任何终端命令(制表符补全在这里很方便)。

于 2015-03-10T18:05:22.590 回答
0

有可能,你可以将vim作为服务器启动,然后添加任意数量的文件,但是我对这个不是很熟悉,所以我不能给你一个方向。

于 2010-12-30T20:17:28.810 回答