2012-02-01 10 views
5

Ho spostato mvim in /usr/local/bin, quindi dal Terminale se digito mvim file.html, quindi MacVim si aprirà in una nuova finestra e aprirà il file file.html.Come posso aprire un nuovo file da Terminale a una scheda anziché una nuova finestra su MacVim?

Ma se apro un altro file dal terminale, si aprirà un'altra finestra di MacVim.

È possibile aprire il nuovo file come nuova scheda su MacVim?

Al momento ho l'impostazione MacVim come

Open files from application: in the current window 
    with a tab for each file 

Ma che aprono solo i nuovi file in una nuova scheda solo se apro il file da MacVim (non in funzione mvim dal Terminal).

risposta

6

This hack dovrebbe funzionare, ma potrebbe essere frustrante mantenere ogni volta che MacVim viene aggiornato. Richiede la modifica dello script mvim. Questo sembra essere un problema di lunga data e noto.

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

Perfetto. Ha fatto esattamente quello che volevo fare. Grazie! – hobbes3

Problemi correlati