@BjörnWincklerの回答は、ファインダーやその他のOSオープンメカニズムを介して開かれたファイルに対してそれを行う方法を示しています。
mvimコマンドで動作させたい場合は、mvim
ファイルを見つけて、下部の行をから変更します。
if [ "$gui" ]; then
# Note: this isn't perfect, because any error output goes to the
# terminal instead of the console log.
# But if you use open instead, you will need to fully qualify the
# path names for any filenames you specify, which is hard.
exec "$binary" -g $opts ${1:+"$@"}
else
exec "$binary" $opts ${1:+"$@"}
fi
に
if [ "$gui" ]; then
# Note: this isn't perfect, because any error output goes to the
# terminal instead of the console log.
# But if you use open instead, you will need to fully qualify the
# path names for any filenames you specify, which is hard.
#make macvim open stuff in the same window instead of new ones
if $tabs && [[ `$binary --serverlist` = "VIM" ]]; then
exec "$binary" -g $opts --remote ${1:+"$@"}
else
exec "$binary" -g $opts ${1:+"$@"}
fi
else
exec "$binary" $opts ${1:+"$@"}
fi
これにより、コマンドラインから開いたすべてのファイルも同じウィンドウで開きます。
また、新しいタブを分割または追加する代わりに、そのファイルがすでに開いている場合に、ファイルで同じバッファを開きたい場合
au VimEnter,BufWinEnter * NERDTreeFind
あなたのgvimrcに(あなたの通常のvimに干渉しないように)
(この最後の部分では、NERDTreeをインストールする必要があります)