summaryrefslogtreecommitdiffstats
path: root/.zshrc
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2011-07-28 00:25:27 +0200
committerGravatar Tom Willemsen2011-07-28 00:25:27 +0200
commit0b0e95e88c1dbd6a9f16300ae03f725e37b6369b (patch)
treec373b1c5a5c49dc72c23ee708fc478d807d00768 /.zshrc
parentaf0eeb3f5251367970b15ef4e614bca56c59ee43 (diff)
downloaddotfiles-0b0e95e88c1dbd6a9f16300ae03f725e37b6369b.tar.gz
dotfiles-0b0e95e88c1dbd6a9f16300ae03f725e37b6369b.zip
Preparing placing home-directory in repo
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc88
1 files changed, 88 insertions, 0 deletions
diff --git a/.zshrc b/.zshrc
new file mode 100644
index 0000000..727548d
--- /dev/null
+++ b/.zshrc
@@ -0,0 +1,88 @@
+# -*- Mode: shell-script -*-
+# Setup variables
+PATH="${PATH}:/usr/local/bin:${HOME}/bin"
+
+HISTFILE=~/.zsh/histfile
+HISTSIZE=1000
+SAVEHIST=1000
+
+setopt notify
+# Allow for functions in the prompt
+setopt PROMPT_SUBST
+setopt EXTENDED_GLOB
+
+zstyle :compinstall filename '/home/slash/.zshrc'
+
+autoload -Uz compinit
+compinit
+
+# Functions
+function env()
+{
+ exec /usr/bin/env "$@" | grep -v ^LESS_TERMCAP_
+}
+
+# Initialize colors.
+autoload -U colors
+colors
+
+# Autoload zsh functions.
+fpath=(~/.zsh/functions $fpath)
+autoload -U ~/.zsh/functions/*(:t)
+
+# Enable auto-execution of functions
+typeset -ga preexec_functions
+typeset -ga precmd_functions
+typeset -ga chpwd_functions
+
+# Append git functions needed for prompt.
+preexec_functions+='preexec_update_git_vars'
+precmd_functions+='precmd_update_git_vars'
+chpwd_functions+='chpwd_update_git_vars'
+chpwd_functions+='chpwd_show_todo'
+
+# Set the prompt.
+PROMPT='(%{${fg[magenta]}%}%m%{${fg[default]}%} %{${fg[cyan]}%}%B%~%b%{${fg[default]}%}) %(?.%{${fg[green]}%}O.%{${fg[red]}%}X)%{${fg[default]}%} %# '
+RPROMPT='$(prompt_git_info)%{${fg[default]}%}'
+
+# Set terminal name to current runnign application
+case $TERM in
+ rxvt*)
+ precmd () { print -Pn "\e]0;%~\a" }
+ preexec () { print -Pn "\e]0;$1\a" }
+ ;;
+esac
+
+# Set terminal keys
+bindkey "\e[1~" beginning-of-line
+bindkey "\e[4~" end-of-line
+bindkey "\e[5~" beginning-of-history
+bindkey "\e[6~" end-of-history
+bindkey "\e[3~" delete-char
+bindkey "\e[2~" quoted-insert
+bindkey "\e[5C" forward-word
+bindkey "\e0c" emacs-forward-word
+bindkey "\e[5D" backward-word
+bindkey "\e0d" emacs-backward-word
+bindkey "\e\e[C" forward-word
+bindkey "\e\e[D" backward-word
+## for rxvt
+bindkey "\e[8~" end-of-line
+bindkey "\e[7~" beginning-of-line
+## for non RH/Debian xterm, can't hurt for RH/Debian xterm
+bindkey "\e0H" beginning-of-line
+bindkey "\e0F" end-of-line
+## for freebsd console
+bindkey "\e[H" beginning-of-line
+bindkey "\e[F" end-of-line
+
+# Show syntax highlighting when we're not running in emacs
+if [ -z $EMACS ]; then
+ source ~/.zsh/syntax-highlighting/zsh-syntax-highlighting.zsh
+
+ ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue'
+ ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue'
+fi
+
+# Execute at startup
+chpwd_show_todo