Add .config/zsh/env.zsh

Add .config/zsh/rc.zsh
Add .config/zsh/.zshenv
Add .config/zsh/.zshrc
This commit is contained in:
eeleater 2022-11-13 16:23:38 +01:00
parent 9877441a5c
commit 00077d17b1
4 changed files with 124 additions and 0 deletions

40
dot_config/zsh/env.zsh Normal file
View file

@ -0,0 +1,40 @@
# xdg stuff
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_STATE_HOME="$HOME/.local/state"
export XDG_CACHE_HOME="$HOME/.cache"
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME"/java
export NUGET_PACKAGES="$XDG_CACHE_HOME"/NuGetPackages
export NB_DIR="$XDG_DATA_HOME/nb"
export NBRC_PATH="$XDG_CONFIG_HOME/nbrc"
export ZSH_EVALCACHE_DIR="$HOME/.cache/evalcache"
export FZF_MARKS_FILE="$HOME/.config/fzfmarks"
export XCURSOR_PATH=/usr/share/icons:${XDG_DATA_HOME}/icons
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
export GOPATH="$XDG_DATA_HOME"/go
# gpg
export GPG_TTY=$TTY
# stuff
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export LESSHISTFILE="-"
# ohmyzsh
export OMP="/usr/share/ohmyzsh/plugins"
export OML="/usr/share/ohmyzsh/lib"
# editor and visual
export EDITOR=nvim
export VISUAL=kate
# sheldon
export SHELDON_CONFIG_DIR="$HOME/.config/sheldon"
export SHELDON_DATA_DIR="$HOME/.local/sheldon"
export SHELDON_CONFIG_FILE="$SHELDON_CONFIG_DIR/plugins.toml"
export SHELDON_LOCK_FILE="$SHELDON_CONFIG_DIR/plugins.lock"
export SHELDON_CLONE_DIR="$SHELDON_DATA_DIR/repos"
export SHELDON_DOWNLOAD_DIR="$SHELDON_DATA_DIR/downloads"
# starship
export STARSHIP_CONFIG="$HOME/.config/starship/config.toml"

82
dot_config/zsh/rc.zsh Normal file
View file

@ -0,0 +1,82 @@
# 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 $OML/history.zsh
source $OML/completion.zsh
source $OML/directories.zsh
# plugins
source $OMP/command-not-found/command-not-found.plugin.zsh
source $OMP/extract/extract.plugin.zsh
source $OMP/systemd/systemd.plugin.zsh
source $OMP/fzf/fzf.plugin.zsh
# plugins (self)
source /usr/share/zsh/plugins/fzf-tab/fzf-tab.zsh
source /usr/share/zsh/plugins/fzf-marks/fzf-marks.zsh
source /usr/share/zsh/plugins/evalcache/evalcache.zsh
source /usr/share/zsh/plugins/colorize/colorize.zsh
source /usr/share/zsh/plugins/titles/titles.zsh
# eval stuff
_evalcache zoxide init zsh
_evalcache dircolors -b /usr/share/LS_COLORS/LS_COLORS
_evalcache keychain --dir "$XDG_CACHE_HOME/keychain" --eval --quiet id_rsa
_evalcache starship init zsh
#_evalcache oh-my-posh init zsh
_evalcache atuin init zsh
_evalcache navi widget 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

View file

@ -0,0 +1 @@
env.zsh

View file

@ -0,0 +1 @@
rc.zsh