You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

114 lines
3.8 KiB

# 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"
fi
#!/bin/zsh
DEFAULT_USER=marc #für den Promot wird der user ausgeblendet, wenn default erkannt ist
# --------------------------------------
# Environment
# --------------------------------------
export EDITOR=nvim
export VISUAL=nvim
# --------------------------------------
# Prompt
# --------------------------------------
setopt PROMPT_SUBST # erlaubt Funktionen im Prompt
# --------------------------------------
# History
# --------------------------------------
HISTFILE=$ZDOTDIR/zhistory
setopt APPEND_HISTORY # append hostory instead of overwriting
HISTSIZE=1200 # notwendig, damit HIST_EXPIRE_DUPS_FIRST funktioniert
SAVEHIST=1000
setopt HIST_EXPIRE_DUPS_FIRST # entfernt erst Duplikate, wenn SAVEHIST überläuft
setopt EXTENDED_HISTORY # speichert Zeitstempel und Dauer
setopt SHARE_HISTORY # share history across terms
# --------------------------------------
# Keybindings
# --------------------------------------
# create a zkbd compatible hash
# to add other keys to this hash, see: man 5 terminfo
typeset -A key
key[Home]="$terminfo[khome]"
key[End]="$terminfo[kend]"
key[Insert]="$terminfo[kich1]"
key[Backspace]="$terminfo[kbs]"
key[Delete]="$terminfo[kdch1]"
key[Up]="$terminfu[kcuu1]"
key[Down]="$terminfo[kcud1]"
key[Left]="$terminfo[kcub1]"
key[Right]="$terminfo[kcuf1]"
key[PageUp]="$terminfo[kpp]"
key[PageDown]="$terminfo[knp]"
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Insert]}" ]] && bindkey "$key[Insert]}" overwrite-mode
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" up-line-or-history
[[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" down-line-or-history
[[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char
[[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char
[[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history
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
# --------------------------------------
# --------------------------------------
# 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