From d4d69a46306135d63e09abeecb34190547a1f912 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 13 May 2020 13:20:33 +0200 Subject: [PATCH] now using zinit plugin manager --- .config/zsh/.zshrc | 108 ++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 56 deletions(-) diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 013857e..78381af 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -1,25 +1,53 @@ -# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.config/zsh/.zshrc. -# Initialization code that may require console input (password prompts, [y/n] -# confirmations, etc.) must go above this block; everything else may go below. -if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then - source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" +#!/bin/zsh + +#zinit installation if it's not there yet +ZINIT_HOME=$XDG_CONFIG_HOME/zsh/.zinit + +if [[ ! -f $ZINIT_HOME/bin/zinit.zsh ]]; then + git clone https://github.com/zdharma/zinit $ZINIT_HOME/bin + zcompile $ZINIT_HOME/bin/zinit.zsh fi -#!/bin/zsh -DEFAULT_USER=marc #für den Promot wird der user ausgeblendet, wenn default erkannt ist +source "$ZINIT_HOME/bin/zinit.zsh" +autoload -Uz zinit +(( ${+_comps} )) && _comps[zinit]=_zinit +#end of installation -# -------------------------------------- -# Environment -# -------------------------------------- +# PLUGINS +# usage see https://github.com/zdharma/zinit + +zinit light zsh-users/zsh-autosuggestions +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=7' + +zinit light zdharma/fast-syntax-highlighting +zinit light chrissicool/zsh-256color + +zinit ice wait"0b" lucid blockf +zinit light zsh-users/zsh-completions + +zstyle ':completion:*' menu select # make menu list of matches +zstyle ':completion:::::' completer _expand _complete _ignored _approximate # be easy on typing errors +zstyle ':completion:*:approximate:*' max-errors 2 # limit errors for matches to 2 +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # match uppercase from lowercase +zstyle ':completion:*' list-colors "${(@s.:.)LS_COLORS}" # use LS_COLORS for matches + +autoload -U compinit && compinit #necessary to make completion work + +#zinit snippet https://github.com/git/git/blob/master/contrib/completion/git-completion.zsh + +## completion for kitty +#kitty + complete setup zsh | source /dev/stdin + +# THEME +zinit light agnoster/agnoster-zsh-theme + +DEFAULT_USER=marc #für den Promot wird der user ausgeblendet, wenn default erkannt ist export EDITOR=nvim export VISUAL=nvim -# -------------------------------------- -# Prompt -# -------------------------------------- - setopt PROMPT_SUBST # erlaubt Funktionen im Prompt +setopt no_beep # no bell # -------------------------------------- # History @@ -70,48 +98,16 @@ bindkey "^R" history-incremental-search-backward # Finally, make sure the terminal is in application mode, when zle is # active. Only then are the values from $erminfo valid. -if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then - function zle-line-init () { - echoti smkx - } - function zle-line-finish () { - echoti rmkx - } - zle -N zle-line-init - zle -N zle-line-finish -fi - -# -------------------------------------- -# Completion -# add completion dir to fpath -fpath=($ZDOTDIR/completion $fpath) -autoload -Uz compinit -compinit - -# completion for kitty -kitty + complete setup zsh | source /dev/stdin - +#if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then +# function zle-line-init () { +# echoti smkx +# } +# function zle-line-finish () { +# echoti rmkx +# } +# zle -N zle-line-init +# zle -N zle-line-finish +#fi -# -------------------------------------- -# Plugins -# -------------------------------------- - -PLUGINS=$ZDOTDIR/plugins/ - -for plugin in $PLUGINS*.zsh -do - source $plugin -done - -source $PLUGINS/zsh-autosuggestions/zsh-autosuggestions.zsh -source $PLUGINS/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - -# -------------------------------------- -# Themes -# -------------------------------------- -source $ZDOTDIR/themes/agnoster.zsh-theme -#source $ZDOTDIR/themes/powerlevel10k/powerlevel10k.zsh-theme -# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. -#[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh