My zsh configuration
git clone https://github.com/m-col/zshrc
Files | Refs | Readme

-rw-r--r-- zshrc


      1 #
      2 # zshrc
      3 #
      4 
      5 if [[ -n "$SSH_CLIENT" ]] || [[ -n "$SSH_TTY" ]]
      6 then
      7     export IS_SSH=true
      8 else
      9     export IS_SSH=false
     10 fi
     11 
     12 if [[ -n "$TMUX" ]]
     13 then
     14     export IS_TMUX=true
     15 else
     16     export IS_TMUX=false
     17 fi
     18 
     19 export IS_DOCKER=${IS_DOCKER:-false}
     20 
     21 # zsh settings
     22 local ZSH="$HOME/.zsh"
     23 HYPHEN_INSENSITIVE="true"
     24 COMPLETION_WAITING_DOTS="true"
     25 ZSH_COMPDUMP="$HOME/.zcompdump"
     26 setopt NO_nomatch
     27 fpath=(~/.zfunc $ZSH/zfunc $fpath)
     28 
     29 # zsh history
     30 HISTFILE="$HOME/.zsh_history"
     31 HISTSIZE=12000
     32 SAVEHIST=8000
     33 #setopt SHARE_HISTORY
     34 setopt HIST_IGNORE_ALL_DUPS
     35 setopt HIST_REDUCE_BLANKS
     36 
     37 # plugins
     38 for plugin ($ZSH/oh-my-zsh/*.zsh $ZSH/*.zsh(N))
     39 do
     40     source $plugin
     41 done
     42 
     43 so () { [[ -e $1 ]] && source $1 }
     44 
     45 so $ZSH/aliases		    # common
     46 so $HOME/.config/aliases    # machine-specific
     47 
     48 ZSH_THEME="ban"
     49 so $ZSH/themes/$ZSH_THEME.zsh-theme
     50 
     51 _Z_DATA=$ZSH/z_data
     52 so $ZSH/z/z.sh
     53 
     54 ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
     55 so $ZSH/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
     56 
     57 LESSHISTFILE=-
     58 
     59 bindkey '^A' autosuggest-execute
     60 
     61 export \
     62     SUDO_EDITOR=nvim \
     63     EDITOR=nvim \
     64     AUR_PAGER=ranger \
     65     TERM=xterm-256color \
     66     LANG=en_GB.UTF-8 \
     67     LC_CTYPE=en_GB.UTF-8 \
     68     PAGER="less --mouse" \
     69     RANGER_LOAD_DEFAULT_RC=FALSE \
     70     PYTHONSTARTUP=~/.zsh/pythonrc.py
     71 
     72 # ensure that the prompt is redrawn when the terminal size changes.
     73 TRAPWINCH () { zle &&  zle -R }
     74 
     75 # If being executed via the '2' script
     76 if [[ -n "$DO2" ]]
     77 then
     78     z $DO2
     79     unset DO2
     80 fi
     81