我移动mvim了/usr/local/bin,所以如果我键入终端mvim file.html,那么MacVim将在新窗口中打开并打开文件file.html.
但是如果我从终端打开另一个文件,那么它将打开另一个 MacVim窗口.
是否可以在MacVim上将新文件作为新标签打开?
我目前将MacVim设置为
Open files from application: in the current window
with a tab for each file
Run Code Online (Sandbox Code Playgroud)
但是,只有当我从MacVim打开文件(不mvim从终端运行)时,才会在新选项卡中打开新文件.
这种破解应该有效,但每次更新MacVim时都要保持这种状态.它要求您编辑mvim脚本.这似乎是一个长期存在的问题.
mvim `which mvim`
## Add the following line to the top of the file, below the commented section:
tabs=true
## Replace the `if` structure at the bottom of the file with the following:
# Last step: fire up vim.
if [ "$gui" ]; then
if $tabs && [[ `$binary --serverlist` = "VIM" ]]; then
exec "$binary" -g $opts --remote-tab-silent ${1:+"$@"}
else
exec "$binary" -g $opts ${1:+"$@"}
fi
else
exec "$binary" $opts ${1:+"$@"}
fi
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2080 次 |
| 最近记录: |