X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=e1e8a1346438753371af7188938e6d510d2a0f28;hb=4ae2112821835457375d257c1939da1385f92b32;hp=32f3831dc71fd07963b94b12e799c3a765c5fc62;hpb=6c6bd10bc7aa19f3fff8e010df44166e2e1c0e10;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 32f3831..e1e8a13 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -453,9 +453,7 @@ zrclocal() { #}}} # locale setup {{{ -if [[ -z "$LANG" ]] ; then - xsource "/etc/default/locale" -fi +xsource "/etc/default/locale" export LANG=${LANG:-en_US.iso885915} for var in LC_ALL LC_MESSAGES ; do @@ -630,6 +628,14 @@ grml_toggle_abbrev() { zle -N grml_toggle_abbrev bindkey '^xA' grml_toggle_abbrev +# add a command line to the shells history without executing it +commit-to-history() { + print -s ${(z)BUFFER} + zle send-break +} +zle -N commit-to-history +bindkey "^x^h" commit-to-history + # }}} # a generic accept-line wrapper {{{ @@ -2465,7 +2471,9 @@ grmlcomp() { # use generic completion system for programs not yet defined; (_gnu_generic works # with commands that provide a --help option with "standard" gnu-like output.) - compdef _gnu_generic tail head feh cp mv df stow uname ipacsum fetchipac + for compcom in tail head feh cp mv df stow uname ipacsum fetchipac; do + [[ -z ${_comps[$compcom]} ]] && compdef _gnu_generic ${compcom} + done; unset compcom # see upgrade function in this file compdef _hosts upgrade @@ -2846,6 +2854,17 @@ minimal-shell() { exec env -i ENV="/etc/minimal-shellrc" HOME="$HOME" TERM="$TERM" ksh } +# a wrapper for vim, that deals with title setting +# VIM_OPTIONS +# set this array to a set of options to vim you always want +# to have set when calling vim (in .zshrc.local), like: +# VIM_OPTIONS=( -p ) +# This will cause vim to send every file given on the +# commandline to be send to it's own tab (needs vim7). +vim() { + VIM_PLEASE_SET_TITLE='yes' command vim ${VIM_OPTIONS} "$@" +} + # make a backup of a file bk() { cp -a "$1" "${1}_$(date --iso-8601=seconds)"