1 # Copyright © 2009-2011, 2017-2018 Nick Bowler
3 # Default configuration for interactive zsh.
5 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
6 # This is free software: you are free to do what the fuck you want to.
7 # There is NO WARRANTY, to the extent permitted by law.
9 # Default shell options
12 if [[ -n $HOME ]]; then
13 HISTFILE=$HOME/.zsh_history
23 *) export KEYMAP=$1 ;;
28 del=('\e[3~') home=('\e[7~') end=('\e[8~') ;;
30 del=('\e[3~') home=('\e[1~') end=('\e[4~') ;;
32 del=('^?') home=('\e[H') end=('\e[F') ;;
35 home=('\e[1~' '\e[H' '\e[OH')
36 end=('\e[4~' '\e[F' '\e[OF')
41 for k in "${del[@]}"; do bindkey "$k" delete-char; done
42 for k in "${home[@]}"; do bindkey "$k" beginning-of-line; done
43 for k in "${end[@]}"; do bindkey "$k" end-of-line; done
48 bindkey '^R' history-incremental-search-forward
49 bindkey '^P' history-incremental-search-backward
64 xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
65 settitle() { print -Pn $'\e]0;%n@%m %33<...<%~%<<\a' }
68 settitle() { print -Pn $'\e_%n@%m %33<...<%~%<<\e\\' }
75 # Show the return code of failed commands, but don't be noisy about it.
79 if [[ -n $__NEWRUN ]]; then
80 RPS1='%(0?,,%B%F{red}RC=%?%f%b)'
91 # A gentoo-like prompt.
92 PS1='%B%(!,%F{red},%F{green}%n@)%m %F{blue}%33<...<%~%<< %#%f%b '
94 if [ -n $COLORTERM ]; then
95 # Assorted colour-related options
96 export MINICOM="-c on"
99 if [[ -n $SSH_CONNECTION ]]; then
100 PS1=${PS1/green/yellow}
104 export LANG=en_CA.UTF-8
105 export LC_COLLATE=ja_JP.UTF-8
107 # Default options for various utilities.
108 alias ls='ls -N --time-style=long-iso --color=auto'
109 alias grep='grep --color=auto'
117 alias vv='$EDITOR ~/.zshrc && source ~/.zshrc'