summaryrefslogtreecommitdiff
path: root/functions.zsh
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2009-08-28 11:14:17 -0700
committerRobby Russell <robby@planetargon.com>2009-08-28 11:14:17 -0700
commit5da20b9dddb1f7a9110675ded5df59c4c3ed1b83 (patch)
tree142b4940f34ce07495c407692a0c299c18df7461 /functions.zsh
parente20401e04e057a39c228dbb99dda68ec7fa4235a (diff)
downloadzsh-5da20b9dddb1f7a9110675ded5df59c4c3ed1b83.tar.gz
zsh-5da20b9dddb1f7a9110675ded5df59c4c3ed1b83.tar.bz2
zsh-5da20b9dddb1f7a9110675ded5df59c4c3ed1b83.zip
Importing initial files after reorganizing stuff.
Diffstat (limited to 'functions.zsh')
-rw-r--r--functions.zsh26
1 files changed, 26 insertions, 0 deletions
diff --git a/functions.zsh b/functions.zsh
new file mode 100644
index 000000000..5c349e80c
--- /dev/null
+++ b/functions.zsh
@@ -0,0 +1,26 @@
+function title {
+ if [[ $TERM == "screen" ]]; then
+ # Use these two for GNU Screen:
+ print -nR $'\033k'$1$'\033'\\\
+
+ print -nR $'\033]0;'$2$'\a'
+ elif [[ $TERM == "xterm" || $TERM == "rxvt" ]]; then
+ # Use this one instead for XTerms:
+ print -nR $'\033]0;'$*$'\a'
+ fi
+}
+
+function precmd {
+ title zsh "$PWD"
+}
+
+function preexec {
+ emulate -L zsh
+ local -a cmd; cmd=(${(z)1})
+ title $cmd[1]:t "$cmd[2,-1]"
+}
+
+
+function remote_console() {
+ /usr/bin/env ssh $1 "( cd $2 && ruby script/console production )"
+} \ No newline at end of file