Created
November 13, 2013 05:56
-
-
Save dexteryy/7444410 to your computer and use it in GitHub Desktop.
gvim/mvim for macvim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
# Last step: fire up vim. | |
# The program should fork by default when started in GUI mode, but it does | |
# not; we work around this when this script is invoked as "gvim" or "rgview" | |
# etc., but not when it is invoked as "vim -g". | |
if [ "$gui" ]; then | |
#make macvim open stuff in the same window instead of new ones | |
if $tabs && [[ `$binary --serverlist` = "VIM" ]]; then | |
#exec "$binary" -g $opts --remote ${1:+"$@"} | |
exec "$binary" -g $opts --remote-tab-silent ${1:+"$@"} | |
else | |
# 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:+"$@"} | |
fi | |
else | |
exec "$binary" $opts ${1:+"$@"} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment