Created
May 10, 2011 22:32
-
-
Save wolever/965519 to your computer and use it in GitHub Desktop.
Vim command to open Terminal.app at the current file's location
This file contains 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
#!/bin/bash | |
# Open Terminal.app at $1 or $PWD | |
if [[ "$1" != "" ]]; then | |
target_dir="$1" | |
else | |
target_dir="$PWD" | |
fi | |
osascript <<EOF | |
tell application "Terminal" | |
activate | |
do script with command "cd \"$target_dir\"" | |
end tell | |
EOF |
This file contains 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
fun! Term() | |
!term "%:p:h" | |
endfun | |
command! Term call Term() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment