summaryrefslogtreecommitdiff
path: root/.zsh/zshrc
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2011-03-17 13:54:24 +0100
committerTobias Klauser <tklauser@distanz.ch>2011-03-17 13:54:24 +0100
commitcb9ce1bbd82c13597c8c66d00a099554bac117e4 (patch)
treecb9aa21d9e69d7931c7f3b56eab653d28b8bb72e /.zsh/zshrc
parent8c39c7b3853710f15d65c2bcfcfcb146d1bf78a6 (diff)
Update from grml's zsh setup
Diffstat (limited to '.zsh/zshrc')
-rw-r--r--.zsh/zshrc/00_opts42
-rw-r--r--.zsh/zshrc/20_compsys33
2 files changed, 63 insertions, 12 deletions
diff --git a/.zsh/zshrc/00_opts b/.zsh/zshrc/00_opts
index 9d4dc14..6d23897 100644
--- a/.zsh/zshrc/00_opts
+++ b/.zsh/zshrc/00_opts
@@ -7,13 +7,43 @@
#
# Source repository: git://git.distanz.ch/dotfiles/zsh.git
-# if a command is issued that can't be executed as a normal command, and the
-# command is the name of a directory, perform the cd command to that directory
-setopt auto_cd
+setopt prompt_subst
-# Silence!
-setopt nobeep
+#
+# the follwing options were taken from grml zshrc
+#
-setopt prompt_subst
+setopt append_history # append history list to the history file
+ # (important for multiple parallel zsh sessions!)
+setopt SHARE_HISTORY # import new commands from the history file also in
+ # other zsh-session
+setopt extended_history # save each command's beginning timestamp and the
+ # duration to the history file
+setopt histignorealldups # If a new command line being added to the
+ # history list duplicates an older one, the older
+ # command is removed from the list
+setopt histignorespace # remove command lines from the history list when
+ # the first character on the line is a space
+setopt auto_cd # if a command is issued that can't be executed as
+ # a normal command, and the command is the name of
+ # a directory, perform the cd command to that
+ # directory
+setopt extended_glob # in order to use #, ~ and ^ for filename generation
+ # grep word *~(*.gz|*.bz|*.bz2|*.zip|*.Z) ->
+ # -> searches for word not in compressed files
+ # don't forget to quote '^', '~' and '#'!
+setopt longlistjobs # display PID when suspending processes as well
+setopt notify # report the status of backgrounds jobs immediately
+setopt hash_list_all # Whenever a command completion is attempted, make sure
+ # the entire command path is hashed first.
+setopt completeinword # not just at the end
+setopt nohup # and don't kill them, either
+setopt auto_pushd # make cd push the old directory onto the directory stack.
+setopt nonomatch # try to avoid the 'zsh: no matches found...'
+setopt nobeep # avoid "beep"ing
+setopt pushd_ignore_dups # don't push the same dir twice.
+setopt noglobdots # * shouldn't match dotfiles. ever.
+setopt noshwordsplit # use zsh style word splitting
+setopt unset # don't error out when unset parameters are used
# vim:ft=zsh
diff --git a/.zsh/zshrc/20_compsys b/.zsh/zshrc/20_compsys
index cd3ae49..eec44d6 100644
--- a/.zsh/zshrc/20_compsys
+++ b/.zsh/zshrc/20_compsys
@@ -2,6 +2,8 @@
#
# configure the completions system
#
+# Parts taken from grml's zsh setup.
+#
# Copyright © 2011 Tobias Klauser <tklauser@distanz.ch>
# Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
# Released under the terms of the Artistic Licence 2.0
@@ -50,15 +52,26 @@ zstyle ':completion:*' cache-path $ZVARDIR/compcache
zstyle ':completion:*' completer _complete _ignored _match _correct _approximate
# allow cursor-key navigation through completion set
-zstyle ':completion:*:*:*:*' menu select
+zstyle ':completion:*:*:*:*' menu select
# use colours in completion lists and menus
-zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
+zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
+
+# activate menu
+zstyle ':completion:*:history-words' menu yes
+
+# ignore duplicate entries
+zstyle ':completion:*:history-words' remove-all-dups yes
+zstyle ':completion:*:history-words' stop yes
+
+# match uppercase from lowercase
+zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
# ignore working and backup copies, and compiled objects
zstyle ':completion:*:(all-|)files' ignored-patterns \
'*.bk' '*.bak' '*.old' '*~' '.*.sw?' '*.o' '*.pyc'
+# allow one error for every three characters typed in approximate completer
zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3)) not-numeric )'
zstyle -e ':completion:*:correct:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/2)) numeric )'
#zstyle ':completion:*:correct:::' max-errors 1 not-numeric
@@ -89,9 +102,21 @@ zstyle -e ':completion:*:*:vim#:*:*' ignored-patterns \
'texfiles=$(echo ${PREFIX}*.tex); [[ -n "$texfiles" ]] &&
reply=(*.(aux|dvi|log|ps|pdf|bbl|toc|lot|lof|latexmain)) || reply=()'
+zstyle ':completion:*:messages' format '%d'
+zstyle ':completion:*:options' auto-description '%d'
+
+# describe options in full
+zstyle ':completion:*:options' description 'yes'
+
# http://madism.org/~madcoder/dotfiles/zsh/40_completion
zstyle ':completion:*:processes' command 'ps -au$USER -o pid,time,cmd|grep -v "ps -au$USER -o pid,time,cmd"'
+# offer indexes before parameters in subscripts
+zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
+
+# provide verbose completion information
+zstyle ':completion:*' verbose true
+
# commands that take commands as arguments
compdef _precommand gdb
compdef _precommand nohup
@@ -111,8 +136,4 @@ zstyle ':completion:*:man:*' menu yes select
# provide .. as a completion
zstyle ':completion:*' special-dirs ..
-# #527301
-zstyle :completion::complete:xmms2:\*:values list-grouped false
-zstyle :completion::complete:xmms2:\*:values sort false
-
# vim:ft=zsh