dotfiles

andersuno dotfiles
git clone git://git.andersuno.nu/dotfiles.git
Log | Files | Refs | README

.zshrc (2591B)


      1 #
      2 # ~/.zshrc
      3 #
      4 
      5 # If not running interactively, don't do anything
      6 [[ $- != *i* ]] && return
      7 
      8 # Lines configured by zsh-newuser-install
      9 HISTFILE=~/.cache/zsh/histfile
     10 HISTSIZE=1000
     11 SAVEHIST=1000
     12 setopt autocd extendedglob
     13 unsetopt beep
     14 bindkey -v
     15 # End of lines configured by zsh-newuser-install
     16 
     17 autoload -U colors && colors
     18 
     19 #autoload -Uz vcs_info
     20 #precmd_vcs_info() { vcs_info }
     21 #precmd_functions+=( precmd_vcs_info )
     22 #setopt prompt_subst
     23 #zstyle ':vcs_info:git:*' check-for-changes true
     24 #zstyle ':vcs_info:git:*' unstagedstr '%F{red}✘%f '
     25 #zstyle ':vcs_info:git:*' stagedstr '%F{red}⇡⇡%f '
     26 #zstyle ':vcs_info:git:*' formats '%c %u%   %F{yellow}  %F{blue}(%F{240}%b%F{blue}) %F{green}<[%F{magenta}%r%F{green}]>%f '
     27 #zstyle ':vcs_info:git:*' actionformats '%a '
     28 #zstyle ':vcs_info:*' enable git
     29 
     30 source $HOME/Repos/zsh-git-prompt/zshrc.sh
     31 RPROMPT='$(git_super_status)    %(?.%F{green}√.%F{red}%? ✘)%f'
     32 
     33 PROMPT="%F{green}┌──[%F{#00bbbb}%n%F{green}@%F{red}%m%F{green}]─[%F{blue}%~%F{green}]"$'\n'"└──╼ %# %f"
     34 #RPROMPT="\$vcs_info_msg_0_  %(?.%F{green}√.%F{red}%? ✘)%f"
     35 
     36 autoload -U compinit
     37 zstyle ':completion:*' menu select
     38 eval "$(dircolors)"
     39 zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
     40 
     41 # Auto complete with case insenstivity
     42 zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
     43 
     44 zmodload zsh/complist
     45 compinit
     46 
     47 # Include hidden files in autocomplete:
     48 _comp_options+=(globdots)
     49 
     50 # Use vim keys in tab complete menu:
     51 bindkey -M menuselect 'h' vi-backward-char
     52 bindkey -M menuselect 'k' vi-up-line-or-history
     53 bindkey -M menuselect 'l' vi-forward-char
     54 bindkey -M menuselect 'j' vi-down-line-or-history
     55 bindkey -v '^?' backward-delete-char
     56 
     57 export KEYTIMEOUT=1
     58 
     59 # Change cursor shape for different vi modes.
     60 function zle-keymap-select {
     61   if [[ ${KEYMAP} == vicmd ]] ||
     62      [[ $1 = 'block' ]]; then
     63     echo -ne '\e[1 q'
     64 
     65   elif [[ ${KEYMAP} == main ]] ||
     66        [[ ${KEYMAP} == viins ]] ||
     67        [[ ${KEYMAP} = '' ]] ||
     68        [[ $1 = 'beam' ]]; then
     69     echo -ne '\e[5 q'
     70   fi
     71 }
     72 zle -N zle-keymap-select
     73 
     74 zle-line-init() {
     75     zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
     76     echo -ne "\e[5 q"
     77 }
     78 zle -N zle-line-init
     79 
     80 # Use beam shape cursor on startup.
     81 echo -ne '\e[5 q'
     82 # Use beam shape cursor for each new prompt.
     83 preexec() { echo -ne '\e[5 q' ;}
     84 
     85 [ -f ~/.bash_aliases ] && source ~/.bash_aliases
     86 
     87 # Load zsh-syntax-highlighting; should be last.
     88 source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null
     89