dots-of-war/zsh/.config/zsh/.zshrc
2023-03-26 10:55:59 +02:00

131 lines
3.6 KiB
Bash

# history config
HISTSIZE=50000
SAVEHIST=50000
HISTFILE="/home/leon/.cache/zsh/history"
setopt HIST_SAVE_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
#setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt SHARE_HISTORY
source "$ZDOTDIR/utils.zsh"
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
### End of Zinit's installer chunk
# some magic to run compinit stuff only once a day, which should speed up zsh startup a good bit
autoload -Uz compinit
for dump in $ZSHDOTDIR/.zcompdump(N.mh+24); do
compinit
done
compinit -C
# this would be the regular version of the above compinit code:
# compinit must be ran before fzf-tab, but fzf-tab must be before syntax highlighting etc
#autoload -Uz compinit
#compinit
zinit light "Aloxaf/fzf-tab"
zinit wait lucid for \
"zsh-users/zsh-history-substring-search" \
"zdharma-continuum/fast-syntax-highlighting" \
"zsh-users/zsh-autosuggestions" \
"olets/zsh-abbr" \
"sudosubin/zsh-github-cli" \
"wfxr/forgit" \
"pkulev/zsh-rustup-completion"
# clear the default keybinds, from utils.zsh
clear-keybinds
# load more stuff
source "$ZDOTDIR/fzf-tab.zsh"
source "$ZDOTDIR/keybinds.zsh"
unalias zi
eval "$(zoxide init zsh)"
# fzf keybindings
[ -f $HOME/.fzf/shell/key-bindings.zsh ] && . $HOME/.fzf/shell/key-bindings.zsh
# some more options
setopt NOBEEP
setopt INTERACTIVE_COMMENTS
# ET nvim as manpager
export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=0"'
autoload -Uz colors && colors
autoload -Uz promptinit && promptinit
# alias
alias ls="exa --icons"
alias dots="git -C $HOME/dots-of-war"
# load prompt
source "$ZDOTDIR/prompt.zsh"
if command -v direnv >/dev/null; then
eval "$(direnv hook zsh)"
fi
export EDITOR=nvim
export VISUAL=nvim
export ANDROID_HOME="/home/leon/Android/Sdk"
export ANDROID_NDK="/home/leon/Android/Sdk/ndk/21.4.7075529"
export JAVA_HOME="/usr/lib/jvm/java-1.19.0-openjdk-amd64/"
if [ -d "$HOME/anaconda3" ]; then
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/leon/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/leon/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/leon/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/leon/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
fi
export PATH="/home/leon/.volta/bin:$PATH"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"