dotfiles/fake_home/.zshrc

104 lines
3.2 KiB
Bash

if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then
source /usr/share/doc/fzf/examples/completion.zsh
fi
HISTFILE=~/.histfile
HISTSIZE=SAVEHIST=100000000
setopt appendhistory autocd notify
setopt menu_complete
unsetopt beep
bindkey -v
autoload -Uz up-line-or-beginning-search
autoload -Uz down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '\eOA' up-line-or-beginning-search
bindkey '\e[A' up-line-or-beginning-search
bindkey '\eOB' down-line-or-beginning-search
bindkey '\e[B' down-line-or-beginning-search
export EDITOR="vim"
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle ':completion:*' matcher-list '+' '+m:{[:lower:]}={[:upper:]}' '+m:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+r:|[._-]=** r:|=** l:|=*'
zstyle :compinstall filename '~/.zshrc'
zstyle ':completion:*' ignored-patterns '*.class'
autoload -Uz compinit
compinit
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
export PATH=~/.bin:$HOME/.dotnet:~/.local/bin:/usr/local/go/bin:$PATH
fignore=(o class swp)
function SetTtyColors() {
echo -en "\e]P0""2c2d27" # black 1
echo -en "\e]P1""f92672" # darkgrey 2
echo -en "\e]P2""00aa00" # darkred 3
echo -en "\e]P3""f92672" # red 4
echo -en "\e]P4""4444aa" # darkgreen 5
echo -en "\e]P5""a6e22e" # green 6
echo -en "\e]P6""f59762" # brown 7
echo -en "\e]P7""fdfff1" # yellow 8
echo -en "\e]P8""f92672" # darkblue 9
echo -en "\e]P9""f92672" # blue 10
echo -en "\e]PA""55ff55" # darkmagenta 11
echo -en "\e]PB""f92672" # magenta 12
echo -en "\e]PC""66d9ef" # darkcyan 13
echo -en "\e]PD""ae81ff" # cyan 14
echo -en "\e]PE""a1efe4" # lightgray 15
echo -en "\e]PF""fdfff1" # white 16
clear
}
if [ "$TERM" = "linux" ]; then
SetTtyColors
fi
source ~/.shell_aliases
source ~/.zsh_local
function pushdot {
cd "$DOT_DIR" || return 1
if [ $# -eq 0 ]; then
git commit -a && git push -u origin main
else
git commit -a -m "$@" && git push -u origin main
fi
cd -
}
function getdot {
cd "$DOT_DIR" || return 1
git pull && ./copy.sh
cd - > /dev/null
}
if which starship &> /dev/null; then
eval "$(starship init zsh)"
fi
last_get_file="/tmp/.$(whoami)-dotfiles-last-get"
current_date="$(date '+%Y-%m-%d')"
if test -d "$DOT_DIR" && [[ "$current_date" != "$(cat "$last_get_file")" ]] &> /dev/null; then
echo "$current_date" > "$last_get_file"
getdot
fi
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
test -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh && source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
test -f "$HOME/.asdf/asdf.sh" && . "$HOME/.asdf/asdf.sh"
test -f ~/.cargo/env && source ~/.cargo/env