This commit is contained in:
GitHub Merge Button 2011-05-02 04:58:54 -07:00
commit 7531d25662
2 changed files with 55 additions and 47 deletions

View file

@ -1,57 +1,57 @@
function savepath() {
pwd > ~/.current_path~
}
function tab() {
savepath
osascript >/dev/null <<EOF
on do_submenu(app_name, menu_name, menu_item, submenu_item)
-- bring the target application to the front
tell application app_name
activate
end tell
tell application "System Events"
tell process app_name
tell menu bar 1
tell menu bar item menu_name
tell menu menu_name
tell menu item menu_item
tell menu menu_item
click menu item submenu_item
end tell
end tell
end tell
end tell
end tell
end tell
tell process "Terminal" to keystroke "t" using command down
end
tell application "Terminal"
activate
do script with command "cd \"$PWD\"; $*" in window 1
end tell
end do_submenu
do_submenu("Terminal", "Shell", "New Tab", 1)
EOF
}
function itab() {
savepath
osascript >/dev/null <<EOF
on do_submenu(app_name, menu_name, menu_item)
-- bring the target application to the front
tell application app_name
activate
end tell
tell application "System Events"
tell process app_name
tell menu bar 1
tell menu bar item menu_name
tell menu menu_name
click menu item menu_item
end tell
end tell
end tell
end tell
end tell
end do_submenu
do_submenu("iTerm", "Shell", "New Tab")
EOF
}
function ntab() {
if [[ $# == 0 ]]; then
ThisDirectory=$PWD
elif [[ $# == 1 && -d "$1" ]]; then
ThisDirectory="$@"
else
print "usage: ntab [directory]"
return 1
fi
if [[ $TERM_PROGRAM != iTerm.app ]]; then
osascript -e " tell application \"System Events\"
tell process \"Terminal\" to keystroke \"t\" using command down
end
tell application \"Terminal\"
activate
do script with command \"cd \\\"$ThisDirectory\\\"\" in window 1
end tell"
return 1
else
osascript -e " tell application \"iTerm\"
make new terminal
tell the front terminal
activate current session
launch session \"Default Session\"
tell the current session
write text \"cd \\\"$PWD\\\"; cd \\\"$ThisDirectory\\\"\"
end tell
end tell
end tell
tell application \"iTerm\"
activate
end tell "
fi
}

8
themes/carter.zsh-theme Normal file
View file

@ -0,0 +1,8 @@
# ZSH Theme - Preview: http://img.skitch.com/20091113-qqtd3j8xinysujg5ugrsbr7x1y.jpg
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='%{$fg[green]%}%n%{$reset_color%} %2~ $(git_prompt_info)%{$reset_color%}%B»%b '
RPS1="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX=" %{$reset_color%}"