diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-03-01 02:47:42 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-03-01 03:02:33 -0600 |
commit | 7e9f161607087ad7c733c6eb776f372a52998180 (patch) | |
tree | b9993ab93f7fe6ff6a7e03a08420aa0f71c80713 | |
parent | 3b861f796f21980ac2b5863e0e442e64708f4a5b (diff) | |
download | conf-7e9f161607087ad7c733c6eb776f372a52998180.tar.gz conf-7e9f161607087ad7c733c6eb776f372a52998180.zip |
add zsh configuration
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | zshcomplete | 15 | ||||
-rw-r--r-- | zshinput | 10 | ||||
-rw-r--r-- | zshrc | 69 |
4 files changed, 97 insertions, 0 deletions
@@ -26,6 +26,9 @@ INSTALL = abcde.conf \ Xdefaults \ xinitrc \ xmobarrc \ + zshcomplete \ + zshinput \ + zshrc \ abook \ sh \ bin \ diff --git a/zshcomplete b/zshcomplete new file mode 100644 index 0000000..19fc375 --- /dev/null +++ b/zshcomplete @@ -0,0 +1,15 @@ +# The following lines were added by compinstall + +zstyle ':completion:*' completer _expand _complete _ignored _prefix +zstyle ':completion:*' expand prefix suffix +zstyle ':completion:*' insert-unambiguous true +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*' list-prompt %S\(%p\)%s +zstyle ':completion:*' list-suffixes true +zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' +zstyle ':completion:*' original false +zstyle :compinstall filename '/home/doy/.zshcomplete' + +autoload -Uz compinit +compinit +# End of lines added by compinstall diff --git a/zshinput b/zshinput new file mode 100644 index 0000000..bcc2eb8 --- /dev/null +++ b/zshinput @@ -0,0 +1,10 @@ +autoload history-search-end +zle -N history-beginning-search-backward-end history-search-end +zle -N history-beginning-search-forward-end history-search-end +bindkey "^[[A" history-beginning-search-backward-end +bindkey "^[[B" history-beginning-search-forward-end + +bindkey "^?" backward-delete-char +bindkey "^H" backward-delete-char + +bindkey "^[[3~" delete-char @@ -0,0 +1,69 @@ +# environment {{{ +# not using .zshenv, because it runs before /etc/profile, and /etc/profile +# tends to hard-set $PATH and such +[ -f "$HOME/.env" ] && source $HOME/.env +# }}} +# Enable colors for ls, etc. Prefer ~/.dir_colors {{{ +if [[ -f ~/.dir_colors ]]; then + eval `dircolors -b ~/.dir_colors` +elif [[ -f /etc/DIR_COLORS ]]; then + eval `dircolors -b /etc/DIR_COLORS` +else + eval `dircolors -b` +fi # }}} +# Change the window title of X terminals {{{ +function term_title_precmd () { + echo -ne "\033]0;${USER}@${HOST}:${PWD/$HOME/~}\007" +} +case ${TERM} in + xterm*|rxvt*|Eterm|aterm|kterm|gnome|screen*) + precmd_functions+=(term_title_precmd) + ;; +esac # }}} +# aliases {{{ +[ -f "$HOME/.aliases" ] && source $HOME/.aliases +# }}} +# external files {{{ +source ~/.zshcomplete +source ~/.zshinput +source ~/.sh/cdhist.sh +# }}} +# zsh configuration {{{ +setopt sharehistory +setopt extendedhistory +setopt histignoredups +setopt nobeep +setopt completeinword +export REPORTTIME=120 +export HISTFILE=$HOME/.zsh_history +export HISTSIZE=1000000000 +export SAVEHIST=1000000000 +# prompt {{{ +function shell_prompt_precmd () { + PROMPT=`fancy-prompt --prompt-escape zsh $?` +} +precmd_functions+=(shell_prompt_precmd) +# }}} +# set the correct perl {{{ +if type perlbrew > /dev/null 2>&1; then + function _setup_perlbrew { + local perl=$PERLBREW_PERL + [ -z $perl ] && perl="$(readlink ${HOME}/perl5/perlbrew/perls/current)" + local pwd="${PWD#${HOME}}/" + if [[ "${pwd:0:6}" == "/work/" ]]; then + if [[ "$perl" != "work-perl" ]]; then + perlbrew use work-perl + fi + else + if [[ "$perl" == "work-perl" ]]; then + perlbrew use perl-5.14.2 + fi + fi + } + precmd_functions+=(_setup_perlbrew) +fi +# }}} +# }}} +# fortune {{{ +fortune -n300 -s ~/.fortune | grep -v -E "^$" +# }}} |