X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;ds=sidebyside;f=zsh%2Frc;h=1d61d6e0090f06dbeac96db5b0c009cecfbe03c3;hb=d80ed1b80a1edd0a9f2aa5525e9ca57f360aad54;hp=74011ab9c316f8f9a4e42f0e9c627c0341e9d9e2;hpb=1cc9894a039d3089518add8b3d5c9eec8ceeb31c;p=config%2Fdotfiles.git diff --git a/zsh/rc b/zsh/rc index 74011ab..1d61d6e 100644 --- a/zsh/rc +++ b/zsh/rc @@ -132,7 +132,8 @@ bindkey -a "^N" history-beginning-search-forward # Use colorized output, necessary for prompts and completions. autoload -U colors && colors -# Some shortcuts for colors. +# Some shortcuts for colors. The %{...%} tells zsh that the data in between +# doesn't need any space, necessary for correct prompt draw. local red="%{${fg[red]}%}" local blue="%{${fg[blue]}%}" local green="%{${fg[green]}%}" @@ -270,7 +271,7 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then m) program_name=mutt ;; - v|vi) + v) program_name=vim ;; esac @@ -326,14 +327,15 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then } # Sets the window title. Works with screen, xterm and rxvt. - window_title() { - if [[ $TERM == screen* ]]; then + if [[ $TERM == screen* ]]; then + window_title() { print -n "\ek$1\e\\" - - elif [[ $TERM == xterm* || $TERM == rxvt* ]]; then + } + elif [[ $TERM == xterm* || $TERM == rxvt* ]]; then + window_title() { print -n "\e]2;$1\e\\" - fi - } + } + fi # Add the preexec() and precmd() hooks. add-zsh-hook preexec window_preexec