X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=2e601190dfc8314640fe4f5f7c5875166d47828e;hb=42234f351bf117030b3eddbe34da5a094b194ced;hp=3554d994d706d0c246b5d9bb946e80b8baa85c6a;hpb=f3f939938a90cc7b0dfd6cd8e83710c8c32edeb5;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 3554d99..2e60119 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3,7 +3,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Mon Feb 11 18:00:55 CET 2008 [mika] +# Latest change: Sam Mai 17 22:52:34 CEST 2008 [mika] ################################################################################ # This file is sourced only for interactive shells. It # should contain commands to set up aliases, functions, @@ -352,7 +352,7 @@ zrcautoload is-at-least || is-at-least() { return 1 } # locale setup {{{ if [[ -z "$LANG" ]] ; then - xsource "/etc/default/locale" + xsource "/etc/default/locale" fi export LANG=${LANG:-en_US.iso885915} @@ -502,6 +502,24 @@ bindkey '^Xi' insert-unicode-char # bindkey . rationalise-dot # bindkey '\eq' push-line-or-edit + +## toggle the ,. abbreviation feature on/off +# NOABBREVIATION: default abbreviation-state +# 0 - enabled (default) +# 1 - disabled +NOABBREVIATION=${NOABBREVIATION:-0} + +grml_toggle_abbrev() { + if (( ${NOABBREVIATION} > 0 )) ; then + NOABBREVIATION=0 + else + NOABBREVIATION=1 + fi +} + +zle -N grml_toggle_abbrev +bindkey '^xA' grml_toggle_abbrev + # }}} # a generic accept-line wrapper {{{ @@ -729,6 +747,12 @@ abk=( globalias() { local MATCH + + if (( NOABBREVIATION > 0 )) ; then + LBUFFER="${LBUFFER},." + return 0 + fi + matched_chars='[.-|_a-zA-Z0-9]#' LBUFFER=${LBUFFER%%(#m)[.-|_a-zA-Z0-9]#} LBUFFER+=${abk[$MATCH]:-$MATCH} @@ -2043,6 +2067,7 @@ for color in BLUE RED GREEN CYAN WHITE ; unset $color # source another config file if present {{{ xsource "/etc/zsh/zshrc.local" +xsource "${HOME}/.zshenv" # }}} # "persistent history" {{{