X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=b33fc976138bd267e1e2ca17ed0b71d40ee32400;hb=8b7ef31432707e80cd9f410843c6cce9eacb0a43;hp=a34b1703c4feee3e6b0fabb2ed0a96b2c154ebde;hpb=47b6a5f5f15d6e00838f2119a24454f24560c76b;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index a34b170..b33fc97 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1077,7 +1077,7 @@ DIRSTACKFILE=${DIRSTACKFILE:-${HOME}/.zdirs} if [[ -f ${DIRSTACKFILE} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) # "cd -" won't work after login by just setting $OLDPWD, so - [[ -d $dirstack[0] ]] && cd $dirstack[0] && cd $OLDPWD + [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD fi chpwd() { @@ -1496,28 +1496,6 @@ iso2utf() { fi } -# set up software synthesizer via speakup -swspeak() { - if [ -x /usr/sbin/swspeak-setup ] ; then - setopt singlelinezle - unsetopt prompt_cr - export PS1="%m%# " - /usr/sbin/swspeak-setup $@ - else # old version: - if ! [[ -r /dev/softsynth ]] ; then - flite -o play -t "Sorry, software synthesizer not available. Did you boot with swspeak bootoption?" - return 1 - else - setopt singlelinezle - unsetopt prompt_cr - export PS1="%m%# " - nice -n -20 speechd-up - sleep 2 - flite -o play -t "Finished setting up software synthesizer" - fi - fi -} - # I like clean prompt, so provide simple way to get that check_com 0 || alias 0='return 0' @@ -2278,17 +2256,6 @@ peval() { } functions peval &>/dev/null && alias calc=peval -# brltty seems to have problems with utf8 environment and/or font Uni3-Terminus16 under -# certain circumstances, so work around it, no matter which environment we have -brltty() { - if [[ -z "$DISPLAY" ]] ; then - consolechars -f /usr/share/consolefonts/default8x16.psf.gz - command brltty "$@" - else - command brltty "$@" - fi -} - # just press 'asdf' keys to toggle between dvorak and us keyboard layout aoeu() { echo -n 'Switching to us keyboard layout: ' @@ -2786,12 +2753,12 @@ fir() { } # smart cd function, allows switching to /etc when running 'cd /etc/fstab' cd() { - if [[ -f ${1} ]]; then + if (( ${#argv} == 1 )) && [[ -f ${1} ]]; then [[ ! -e ${1:h} ]] && return 1 print "Correcting ${1} to ${1:h}" builtin cd ${1:h} else - builtin cd ${1} + builtin cd "$@" fi } @@ -3638,9 +3605,9 @@ if check_com -c highlight ; then lang=${1%:*} [[ ${1} == *:* ]] && [[ -n ${1#*:} ]] && theme=${1#*:} if [[ -n ${theme} ]] ; then - highlight --xterm256 --syntax ${lang} --style ${theme} ${2} | less -SMr + highlight -O xterm256 --syntax ${lang} --style ${theme} ${2} | less -SMr else - highlight --ansi --syntax ${lang} ${2} | less -SMr + highlight -O ansi --syntax ${lang} ${2} | less -SMr fi ;; esac