summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--zshcomplete15
-rw-r--r--zshinput10
-rw-r--r--zshrc69
4 files changed, 97 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 09a5a02..aa6d535 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/zshrc b/zshrc
new file mode 100644
index 0000000..5bb6a22
--- /dev/null
+++ b/zshrc
@@ -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 "^$"
+# }}}