dotfiles

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

commit c3191c8d927bfe401bb0a50821b7a9025bdc78d0
parent 661fa77e464ce988400b80a8d406da2c3d39b1e5
Author: andersuno <anders.hedman01@gmail.com>
Date:   Mon, 21 Jun 2021 17:55:10 +0200

Added zshrc

Diffstat:
A.config/zsh/.zshrc | 89+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 89 insertions(+), 0 deletions(-)

diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc @@ -0,0 +1,89 @@ +# +# ~/.zshrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +# Lines configured by zsh-newuser-install +HISTFILE=~/.cache/zsh/histfile +HISTSIZE=1000 +SAVEHIST=1000 +setopt autocd extendedglob +unsetopt beep +bindkey -v +# End of lines configured by zsh-newuser-install + +autoload -U colors && colors + +#autoload -Uz vcs_info +#precmd_vcs_info() { vcs_info } +#precmd_functions+=( precmd_vcs_info ) +#setopt prompt_subst +#zstyle ':vcs_info:git:*' check-for-changes true +#zstyle ':vcs_info:git:*' unstagedstr '%F{red}✘%f ' +#zstyle ':vcs_info:git:*' stagedstr '%F{red}⇡⇡%f ' +#zstyle ':vcs_info:git:*' formats '%c %u%  %F{yellow} %F{blue}(%F{240}%b%F{blue}) %F{green}<[%F{magenta}%r%F{green}]>%f ' +#zstyle ':vcs_info:git:*' actionformats '%a ' +#zstyle ':vcs_info:*' enable git + +source $HOME/Repos/zsh-git-prompt/zshrc.sh +RPROMPT='$(git_super_status) %(?.%F{green}√.%F{red}%? ✘)%f' + +PROMPT="%F{green}┌──[%F{#00bbbb}%n%F{green}@%F{red}%m%F{green}]─[%F{blue}%~%F{green}]"$'\n'"└──╼ %# %f" +#RPROMPT="\$vcs_info_msg_0_ %(?.%F{green}√.%F{red}%? ✘)%f" + +autoload -U compinit +zstyle ':completion:*' menu select +eval "$(dircolors)" +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} + +# Auto complete with case insenstivity +zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +zmodload zsh/complist +compinit + +# Include hidden files in autocomplete: +_comp_options+=(globdots) + +# Use vim keys in tab complete menu: +bindkey -M menuselect 'h' vi-backward-char +bindkey -M menuselect 'k' vi-up-line-or-history +bindkey -M menuselect 'l' vi-forward-char +bindkey -M menuselect 'j' vi-down-line-or-history +bindkey -v '^?' backward-delete-char + +export KEYTIMEOUT=1 + +# Change cursor shape for different vi modes. +function zle-keymap-select { + if [[ ${KEYMAP} == vicmd ]] || + [[ $1 = 'block' ]]; then + echo -ne '\e[1 q' + + elif [[ ${KEYMAP} == main ]] || + [[ ${KEYMAP} == viins ]] || + [[ ${KEYMAP} = '' ]] || + [[ $1 = 'beam' ]]; then + echo -ne '\e[5 q' + fi +} +zle -N zle-keymap-select + +zle-line-init() { + zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) + echo -ne "\e[5 q" +} +zle -N zle-line-init + +# Use beam shape cursor on startup. +echo -ne '\e[5 q' +# Use beam shape cursor for each new prompt. +preexec() { echo -ne '\e[5 q' ;} + +[ -f ~/.bash_aliases ] && source ~/.bash_aliases + +# Load zsh-syntax-highlighting; should be last. +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null +