My zsh configuration
git clone https://mcol.xyz/code/zshrc
Log | Files | Refs | Submodules | README

commit 92954c191e57533b00951b7409b2ce1fb8fed0d7
parent 7c630d03f9eb8f8231008d2969c6a87230437f1d
Author: mcol <mcol@posteo.net>
Date:   Thu, 21 Feb 2019 21:17:52 +0000

clean up tmux variable and zshrc

Diffstat:
Mthemes/ban.zsh-theme | 8++++----
Mzshrc | 24+++++++++++++++++-------
2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/themes/ban.zsh-theme b/themes/ban.zsh-theme @@ -8,7 +8,7 @@ CURRENT_BG='NONE' local LC_ALL="" LC_CTYPE="en_US.UTF-8" # prompt segment shape: arrow or square -if $is_ssh +if $IS_SSH then SEGMENT_SEPARATOR_L=$'\ue0b0' SEGMENT_SEPARATOR_R=$'' @@ -46,7 +46,7 @@ prompt_end() { } prompt_context() { - if $is_ssh; then + if $IS_SSH; then prompt_segment green black " %(!.%{%F{yellow}%}.)$USER@$HOST " fi } @@ -124,7 +124,7 @@ prompt_status() { } -if $is_ssh +if $IS_SSH then tmux_following_colour=green else @@ -133,7 +133,7 @@ fi prompt_tmux() { local tmux_indicator local SEGMENT_SEPARATOR='' - if [[ -n "$TMUX" ]] + if $IS_TMUX then tmux_indicator=$'\ue0b0' else diff --git a/zshrc b/zshrc @@ -2,10 +2,18 @@ # zshrc # -if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then - export is_ssh=true +if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] +then + export IS_SSH=true else - export is_ssh=false + export IS_SSH=false +fi + +if [[ -n "$TMUX" ]] +then + export IS_TMUX=true +else + export IS_TMUX=false fi ZSH="$HOME/.zsh" @@ -20,7 +28,6 @@ do source $plugin done - so () { [[ -e $1 ]] && source $1 } so $ZSH/aliases # general aliases @@ -35,12 +42,15 @@ so $ZSH/z/z.sh ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets) so $ZSH/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +export SUDO_EDITOR=vim +export EDITOR=vim # Ensure that the prompt is redrawn when the terminal size changes. -TRAPWINCH () { - zle && zle -R -} +TRAPWINCH () { zle && zle -R } # these are needed for some unicode to work (e.g. in tmux) export LANG=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8 + +# don't load default ranger config +export RANGER_LOAD_DEFAULT_RC=FALSE