3ab0d639d0f6feaf6612badd932542d206fc5450
- Author
- Geoff Garside <geoff@geoffgarside.co.uk>
- Committer
- Geoff Garside <geoff@geoffgarside.co.uk>
- Date
Message
Add tab, take and tm functions
Diff
1diff --git a/functions.zsh b/functions.zsh
2index dcabed9577152425faef7d5142fde3ed0b1686a3..0dcfbd39a109f77d12a5bec994b0b0127caefbec 100644
3--- a/functions.zsh
4+++ b/functions.zsh
5@@ -22,4 +22,26 @@ function preexec {
6
7 function remote_console() {
8 /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
9-}
10+}
11+
12+function tab() {
13+ osascript 2>/dev/null <<EOF
14+ tell application "System Events"
15+ tell process "Terminal" to keystroke "t" using command down
16+ end
17+ tell application "Terminal"
18+ activate
19+ do script with command "cd $PWD; $*" in window 1
20+ end tell
21+EOF
22+}
23+
24+function take() {
25+ mkdir -p $1
26+ cd $1
27+}
28+
29+function tm() {
30+ cd $1
31+ mate $1
32+}