# 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 # To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. [[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh # compinit autoload -Uz compinit compinit -d $XDG_CACHE_HOME/zsh/compdump # autosuggestions source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh # history mkdir -p "$XDG_CACHE_HOME/zsh" &>/dev/null export SAVEHIST=1048576 export HISTSIZE=1048576 export HISTFILE="$XDG_CACHE_HOME/zsh/history" setopt inc_append_history # libraries source /usr/share/ohmyzsh/lib/history.zsh source /usr/share/ohmyzsh/lib/completion.zsh source /usr/share/ohmyzsh/lib/directories.zsh # plugins plugins=(command-not-found systemd fzf) for plugin ($plugins); do source "/usr/share/ohmyzsh/plugins/$plugin/$plugin.plugin.zsh"; done plugins=(fzf-tab fzf-marks evalcache colorize titles thefuck forgit) for plugin ($plugins); do source "/usr/share/zsh/plugins/$plugin/$plugin.zsh"; done unset plugins # eval stuff _evalcache zoxide init zsh _evalcache dircolors -b /usr/share/LS_COLORS/LS_COLORS _evalcache atuin init zsh _evalcache navi widget zsh _evalcache direnv hook zsh source /opt/asdf-vm/asdf.sh eval "$(keychain --dir "$XDG_CACHE_HOME/keychain" --eval --quiet id_rsa)" #themes source /home/weger/.config/zsh/distroicon.zsh source /usr/share/zsh/themes/powerlevel10k/powerlevel10k.zsh-theme #_evalcache starship init zsh #_evalcache oh-my-posh init zsh # aliases alias ls='exa' alias l='exa -al --color=always --group-directories-first' alias cat='bat' alias cd='z' alias grep='rg' alias find='fd' # make rm, cp and mv safer alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # misc aliases alias tree='tree -a -I .git' alias https='http --default-scheme=https' alias termbin="nc termbin.com 9999" alias ktheme='kitty +kitten themes --reload-in=all' if (( ${+commands[nvim]} )); then alias vim="nvim"; fi # key bindings run_ranger () { echo; ranger < $TTY; zle redisplay } zle -N run_ranger bindkey '^f' run_ranger # use known_hosts for completion zstyle -e ':completion:*:(ssh|scp|sftp|rsh|rsync):hosts' hosts 'reply=(${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) /dev/null)"}%%[# ]*}//,/ })' # order stuff zstyle ':completion:*:(scp|ssh):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *' zstyle ':completion:*:scp:*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr # ignored patterns zstyle ':completion:*:*:*:users' ignored-patterns '*' zstyle ':completion:*:*:*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost localhost4 localhost6 ip6-localhost broadcasthost zstyle ':completion:*:*:*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*' '*localdomain*' '*.eeleater.org' '*.local' '*.hbz-nrw.de' zstyle ':completion:*:*:*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*' # syntax highlighting source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh