.zshrc (2753B) - raw


      1 #  ______ _____ _    _
      2 # |___  // ____| |  | |
      3 #    / /| (___ | |__| |
      4 #   / /  \___ \|  __  |
      5 #  / /__ ____) | |  | |
      6 # /_____|_____/|_|  |_|
      7 #
      8 
      9 # The following lines were added by compinstall
     10 zstyle ':completion:*' completer _complete _ignored _correct _approximate
     11 zstyle ':completion:*' file-sort name
     12 zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-,]=** r:|=**'
     13 zstyle ':completion:*' preserve-prefix '//[^/]##/'
     14 zstyle ':completion:*' squeeze-slashes true
     15 zstyle :compinstall filename '/home/master/.zshrc'
     16 
     17 autoload -Uz compinit
     18 zstyle ':completion:*' menu select
     19 zmodload zsh/complist
     20 
     21 compinit
     22 # End of lines added by compinstall
     23 
     24 # Vim keys in tab complete menu:
     25 bindkey -M menuselect 'h' vi-backward-char
     26 bindkey -M menuselect 'k' vi-up-line-or-history
     27 bindkey -M menuselect 'l' vi-forward-char
     28 bindkey -M menuselect 'j' vi-down-line-or-history
     29 
     30 export KEYTIMEOUT=1
     31 
     32 # Change cursor shape for different vi modes.
     33 function zle-keymap-select {
     34   if [[ ${KEYMAP} == vicmd ]] ||
     35      [[ $1 = 'block' ]]; then
     36     echo -ne '\e[1 q'
     37 
     38   elif [[ ${KEYMAP} == main ]] ||
     39        [[ ${KEYMAP} == viins ]] ||
     40        [[ ${KEYMAP} = '' ]] ||
     41        [[ $1 = 'beam' ]]; then
     42     echo -ne '\e[4 q'
     43   fi
     44 }
     45 zle -N zle-keymap-select
     46 
     47 zle-line-init() {
     48     zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere)
     49     echo -ne "\e[4 q"
     50 }
     51 zle -N zle-line-init
     52 
     53 # Use beam shape cursor on startup.
     54 echo -ne '\e[4 q'
     55 # Use beam shape cursor for each new prompt.
     56 preexec() { echo -ne '\e[4 q' ;}
     57 
     58 
     59 # Lines configured by zsh-newuser-install
     60 HISTFILE=~/.cache/zsh-history
     61 HISTSIZE=1000
     62 SAVEHIST=10000
     63 setopt appendhistory autocd extendedglob nomatch
     64 unsetopt beep notify
     65 bindkey -v
     66 # End of lines configured by zsh-newuser-install
     67 
     68 # Git current branch setup
     69 autoload -Uz vcs_info
     70 precmd_vcs_info() { vcs_info }
     71 precmd_functions+=( precmd_vcs_info )
     72 setopt prompt_subst
     73 
     74 # Prompt theme
     75 PROMPT=" %B%F{blue}𝜑 %b%F{yellow}"
     76 # PROMPT=" %B%F{blue}π %b%F{yellow}"
     77 # RPROMPT="\$vcs_info_msg_1_ %B%F{magenta}(%B%F{cyan}%1/%B%F{magenta})"
     78 RPROMPT="\$vcs_info_msg_0_ %B%F{magenta}(%B%F{cyan}%1/%B%F{magenta})"
     79 
     80 zstyle ':vcs_info:git:*' formats '%b'
     81 
     82 # Loading shortcuts made by aliasgen and shortcutgen
     83 source $HOME/.cache/zsh-aliases*
     84 source $HOME/.cache/zsh-shortcuts
     85 source $HOME/.cache/shell-vars
     86 
     87 # Vifm with sensible cd option
     88 vicd()
     89 {
     90     local dst="$(command vifmrun --choose-dir - "$@")"
     91 		[[ "$dst" == "" ]] && \
     92         echo 'Directory picking cancelled/failed' && \
     93         return 1 \
     94     || cd "$dst"
     95 }
     96 
     97 # Load zsh-syntax-highlighting; should be last.
     98 source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null
     99 
    100 eval $(thefuck --alias)