Skip to content

Instantly share code, notes, and snippets.

@gregmalcolm
Created October 28, 2012 16:57
Show Gist options
  • Save gregmalcolm/3969143 to your computer and use it in GitHub Desktop.
Save gregmalcolm/3969143 to your computer and use it in GitHub Desktop.
Script for opening MacVim with gvim style file argument handling
#!/bin/bash
args="$*"
first="$1"
if [[ "$first" == "" ]]; then
# Open mvim at the current directory
args="."
else
if [[ ! -a "$first" ]]; then
# If the file doesn't exist yet, create it
touch $first
fi
fi
open -a MacVim $args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment