2012-02-01 13 views
5

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を実行していない)MacVimからファイルを開いた場合にのみ、新しいタブで新しいファイルを開きます。

答えて

6

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:+"[email protected]"} 
    else 
    exec "$binary" -g $opts ${1:+"[email protected]"} 
    fi 
else 
    exec "$binary" $opts ${1:+"[email protected]"} 
fi 
+0

パーフェクト。それはまさに私がやりたかったことでした。ありがとうございました! – hobbes3

関連する問題