Skip to content

Instantly share code, notes, and snippets.

@jgr

jgr/v

Created May 18, 2012 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgr/2727598 to your computer and use it in GitHub Desktop.
Save jgr/2727598 to your computer and use it in GitHub Desktop.
V command
#!/usr/bin/env bash
if [[ $# -eq 0 ]]; then
if mvim --serverlist | egrep -i "^$(basename $(pwd))$"; then
osascript -e 'tell application "MacVim" to activate' > /dev/null 2>&1
else
mvim -c "e ." --servername $(basename $(pwd))
fi
else
mvim -c "wincmd l" --servername $(basename $(pwd)) --remote "$@" 1>/dev/null 2>&1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment