gpt4 book ai didi

vim - 如何从终端打开一个新文件到一个选项卡,而不是在MacVim上打开一个新窗口?

转载 作者:行者123 更新时间:2023-12-04 18:49:02 27 4
gpt4 key购买 nike

我将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

但这仅在我从MacVim中打开文件时才在新选项卡中打开新文件(不从终端运行 mvim)。

最佳答案

This hack应该可以工作,但是每次更新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

关于vim - 如何从终端打开一个新文件到一个选项卡,而不是在MacVim上打开一个新窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9100924/

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