aboutsummaryrefslogtreecommitdiffstats
path: root/_zsh/hooks.zsh
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@gmail.com>2016-01-30 16:45:56 +0800
committerAaron LI <aaronly.me@gmail.com>2016-01-30 16:45:56 +0800
commit1a80abd95d93db9e0a3b0646bd346ee9e6a5fcd5 (patch)
treeff5b43ab61daf533239b8bfcec7cb83e1abf76c4 /_zsh/hooks.zsh
parentb62cedb2184891fbb480b13dae4485c375450edd (diff)
downloaddotfiles-1a80abd95d93db9e0a3b0646bd346ee9e6a5fcd5.tar.bz2
Rip out the heavy oh-my-zsh ...
Credits: [1] https://github.com/spicycode/ze-best-zsh-config [2] Zsh Configuration from the Ground Up http://zanshin.net/2013/02/02/zsh-configuration-from-the-ground-up/
Diffstat (limited to '_zsh/hooks.zsh')
-rw-r--r--_zsh/hooks.zsh28
1 files changed, 28 insertions, 0 deletions
diff --git a/_zsh/hooks.zsh b/_zsh/hooks.zsh
new file mode 100644
index 0000000..9e18053
--- /dev/null
+++ b/_zsh/hooks.zsh
@@ -0,0 +1,28 @@
+#
+# zsh/hooks.zsh
+#
+
+function precmd {
+ # vcs_info
+ # Put the string "hostname::/full/directory/path" in the title bar:
+ echo -ne "\e]2;$PWD\a"
+
+ # Put the parentdir/currentdir in the tab
+ echo -ne "\e]1;$PWD:h:t/$PWD:t\a"
+}
+
+
+function set_running_app {
+ printf "\e]1; $PWD:t:$(history $HISTCMD | cut -b7- ) \a"
+}
+
+function preexec {
+ set_running_app
+}
+
+function postexec {
+ set_running_app
+}
+
+
+# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=zsh: #