summaryrefslogtreecommitdiffstats
path: root/zsh
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-11-03 21:21:21 +0100
committerGravatar Tom Willemse2013-11-03 21:21:21 +0100
commit5c6cd059e8395d7f24d4b199e59c8c2f562dc438 (patch)
tree2e108e0724b5f5248de11c515312fa8c7c04ab4c /zsh
parentcca8771d855a3c8ba67bcb43a45967d9e4b6dd15 (diff)
downloaddotfiles-5c6cd059e8395d7f24d4b199e59c8c2f562dc438.tar.gz
dotfiles-5c6cd059e8395d7f24d4b199e59c8c2f562dc438.zip
New stow hierarchy
Diffstat (limited to 'zsh')
l---------zsh/.bash_profile1
-rw-r--r--zsh/.zprofile15
-rw-r--r--zsh/.zsh/.gitignore1
-rw-r--r--zsh/.zsh/functions/add-to-list10
-rw-r--r--zsh/.zsh/functions/env3
-rw-r--r--zsh/.zsh/functions/venv15
-rw-r--r--zsh/.zshrc126
7 files changed, 171 insertions, 0 deletions
diff --git a/zsh/.bash_profile b/zsh/.bash_profile
new file mode 120000
index 0000000..c1abe3f
--- /dev/null
+++ b/zsh/.bash_profile
@@ -0,0 +1 @@
+.zprofile \ No newline at end of file
diff --git a/zsh/.zprofile b/zsh/.zprofile
new file mode 100644
index 0000000..4a74a84
--- /dev/null
+++ b/zsh/.zprofile
@@ -0,0 +1,15 @@
+export BROWSER=conkeror
+export EDITOR="emacsclient -c -a emacs"
+
+PATH="$HOME/usr/bin:$PATH"
+export PATH
+
+INFOPATH="$HOME/documents/info:$INFOPATH"
+INFOPATH="$HOME/.emacs.d/vendor-lisp/org/doc:$INFOPATH"
+INFOPATH="$INFOPATH:/usr/share/info"
+INFOPATH="$INFOPATH:/usr/local/share/info"
+export INFOPATH
+
+if [ -z "$SSH_AGENT_PID" ]; then
+ eval `ssh-agent`
+fi
diff --git a/zsh/.zsh/.gitignore b/zsh/.zsh/.gitignore
new file mode 100644
index 0000000..b9fd690
--- /dev/null
+++ b/zsh/.zsh/.gitignore
@@ -0,0 +1 @@
+histfile
diff --git a/zsh/.zsh/functions/add-to-list b/zsh/.zsh/functions/add-to-list
new file mode 100644
index 0000000..18720e0
--- /dev/null
+++ b/zsh/.zsh/functions/add-to-list
@@ -0,0 +1,10 @@
+# -*- mode: sh; -*-
+if [[ ! "${(P)${1}}" =~ (^|:)"$2"(:|$) ]]; then
+ if [ -n "$3" ]; then
+ # Append
+ typeset -g $1="${(P)${1}}:$2"
+ else
+ # Prepend
+ typeset -g $1="$2:${(P)${1}}"
+ fi
+fi
diff --git a/zsh/.zsh/functions/env b/zsh/.zsh/functions/env
new file mode 100644
index 0000000..a79fd5d
--- /dev/null
+++ b/zsh/.zsh/functions/env
@@ -0,0 +1,3 @@
+# -*- mode: shell-script -*-
+
+/usr/bin/env "$@" | grep -v \^LESS_TERMCAP_
diff --git a/zsh/.zsh/functions/venv b/zsh/.zsh/functions/venv
new file mode 100644
index 0000000..03ec83d
--- /dev/null
+++ b/zsh/.zsh/functions/venv
@@ -0,0 +1,15 @@
+# -*- mode: sh; -*-
+if [ "${#}" -eq 1 ]; then
+ local venv_activate="$HOME/.virtualenv/$1/bin/activate"
+
+ if [ -r "$venv_activate" ]; then
+ source $venv_activate
+ else
+ echo "$1 is not a know virtual environment"
+ fi
+else
+ echo "Virtual environments: "
+ for itm in ~/.virtualenv/*; do
+ echo " $(basename $itm)"
+ done
+fi
diff --git a/zsh/.zshrc b/zsh/.zshrc
new file mode 100644
index 0000000..d4fb2ad
--- /dev/null
+++ b/zsh/.zshrc
@@ -0,0 +1,126 @@
+# -*- Mode: shell-script; -*-
+autoload -Uz add-zsh-hook
+autoload -Uz compinit
+autoload -U colors
+autoload -Uz vcs_info
+
+# Autoload zsh functions.
+fpath=($HOME/.zsh/functions $fpath)
+autoload -U $HOME/.zsh/functions/*(:t)
+
+# Setup variables
+HISTFILE=$HOME/.zsh/histfile
+HISTSIZE=1000
+SAVEHIST=1000
+LESSCMD="/usr/bin/less -FXRS"
+
+export LESS_TERMCAP_mb=$'\e[1;37m'
+export LESS_TERMCAP_md=$'\e[1;37m'
+export LESS_TERMCAP_me=$'\e[0m'
+export LESS_TERMCAP_se=$'\e[0m'
+export LESS_TERMCAP_so=$'\e[1;47;30m'
+export LESS_TERMCAP_ue=$'\e[0m'
+export LESS_TERMCAP_us=$'\e[0;36m'
+export PAGER=$LESSCMD
+
+# Aliases
+alias alpine="alpine -p ""{imap.gmail.com/ssl/user=tom.willemsen@archlinux.us}remote_pinerc"""
+alias evolus-pencil="/usr/lib/evolus-pencil-svn/evolus-pencil.sh"
+alias grep="grep --color=always"
+alias less=$LESSCMD
+alias ls="ls -F --color=always"
+alias mysql="mysql --pager"
+
+# Suffix aliases
+alias -s pdf="zathura"
+alias -s xls="libreoffice"
+
+setopt AUTO_CD
+setopt AUTO_PUSHD
+setopt CORRECT
+setopt EXTENDED_GLOB
+setopt NOTIFY
+setopt PROMPT_SUBST # Allow for functions in the prompt
+
+zstyle :compinstall filename '$HOME/.zshrc'
+
+# Enable auto-execution of functions
+typeset -ga preexec_functions
+typeset -ga precmd_functions
+typeset -ga chpwd_functions
+
+add-zsh-hook precmd vcs_info
+
+zstyle ':vcs_info:*' actionformats '%B%F{1}%a%f%%b (%F{3}%s%f) %F{5}%r%f:%F{4}%b%f %F{2}%S%f'
+zstyle ':vcs_info:*' enable bzr git hg svn
+zstyle ':vcs_info:*' formats '(%F{3}%s%f) %F{5}%r%f:%F{4}%b%f %F{2}%S%f'
+zstyle ':vcs_info:*' nvcsformats '%F{2}%~%f'
+zstyle ':vcs_info:bzr:*' branchformat '%b'
+
+# Set the prompt.
+PROMPT='${vcs_info_msg_0_}
+%B%F{6}%m%b%f %B%(?.%F{2}+.%F{1}-)%b> '
+
+# Set terminal name to current running application
+case $TERM in
+ rxvt*)
+ precmd () { print -Pn "\e]0;%~\a" }
+ preexec () { print -Pn "\e]0;$1\a" }
+ ;;
+esac
+
+export XDG_CACHE_HOME="$HOME/.cache"
+export XDG_CONFIG_HOME="$HOME/.config"
+export XDG_DATA_HOME="$HOME/.local/share"
+
+# 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
+
+bindkey "^W" backward-delete-char
+
+# Show syntax highlighting when we're not running in emacs
+if [ -z $EMACS ]; then
+ source $HOME/.zsh/syntax-highlighting/zsh-syntax-highlighting.zsh
+
+ ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
+
+ ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=red'
+ ZSH_HIGHLIGHT_STYLES[builtin]='fg=cyan'
+ ZSH_HIGHLIGHT_STYLES[function]='fg=blue'
+ ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=blue'
+ ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=blue'
+ ZSH_HIGHLIGHT_STYLES[back-quoted-argument]='fg=cyan'
+ ZSH_HIGHLIGHT_STYLES[single-quoted-argument]='fg=cyan'
+ ZSH_HIGHLIGHT_STYLES[double-quoted-argument]='fg=cyan'
+ ZSH_HIGHLIGHT_STYLES[assign]='fg=yellow'
+
+ ZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=red'
+ ZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=yellow'
+ ZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=green'
+ ZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=cyan'
+ ZSH_HIGHLIGHT_STYLES[bracket-level-5]='fg=blue'
+ ZSH_HIGHLIGHT_STYLES[bracket-level-6]='fg=magenta'
+fi
+
+compinit
+colors # Initialize colors.