mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge 13832fd04c into 0365ef0529
This commit is contained in:
commit
7531d25662
2 changed files with 55 additions and 47 deletions
|
|
@ -1,57 +1,57 @@
|
||||||
function savepath() {
|
|
||||||
pwd > ~/.current_path~
|
|
||||||
}
|
|
||||||
|
|
||||||
function tab() {
|
function tab() {
|
||||||
savepath
|
|
||||||
osascript >/dev/null <<EOF
|
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 application "System Events"
|
||||||
tell process app_name
|
tell process "Terminal" to keystroke "t" using command down
|
||||||
tell menu bar 1
|
end
|
||||||
tell menu bar item menu_name
|
tell application "Terminal"
|
||||||
tell menu menu_name
|
activate
|
||||||
tell menu item menu_item
|
do script with command "cd \"$PWD\"; $*" in window 1
|
||||||
tell menu menu_item
|
|
||||||
click menu item submenu_item
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
end tell
|
end tell
|
||||||
end do_submenu
|
|
||||||
|
|
||||||
do_submenu("Terminal", "Shell", "New Tab", 1)
|
|
||||||
EOF
|
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
8
themes/carter.zsh-theme
Normal 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%}"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue