Archived
0
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.zshrc

110 lines
2.9 KiB
Bash

# Set PATH
export PATH=$PATH:$HOME/.spicetify:/opt/cuda/bin
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# omz configs
HYPHEN_INSENSITIVE=true
UPDATE_ZSH_DAYS=7
ENABLE_CORRECTION=true
COMPLETION_WAITING_DOTS=true
# Plugins
plugins=(zsh-history-substring-search zsh-autosuggestions bgnotify colored-man-pages nvm rust docker docker-compose dotnet zsh-syntax-highlighting)
# Plugin Configs
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor root line)
zstyle ':omz:plugins:nvm' autoload true
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
source $ZSH/oh-my-zsh.sh
# You may need to manually set your language environment
export LANG=en_US.UTF-8
# Preferred editor
export EDITOR='nvim'
# Compilation flags
export MAKEFLAGS="-j16"
# Aliases
alias nano="nvim"
alias vi="nvim"
alias vim="nvim"
alias ls="exa -laFghHUum@ --sort name --group-directories-first --git --icons "
alias tree="exa -laFghHUumRT@ --sort name --group-directories-first --git --icons"
alias rr="curl -s -L http://bit.ly/10hA8iC | bash"
alias cat="bat"
alias parrot="curl parrot.live"
alias neofetch="hyfetch"
alias man="batman"
alias gitdiff="batdiff"
# Prevent dotnet from tracking me
export DOTNET_CLI_TELEMETRY_OPTOUT=true
# Command not found
function command_not_found_handler {
local pkgs cmd="$1"
pkgs=(${(f)"$(pkgfile -b -v -- "$cmd" 2>/dev/null)"})
if [[ -n "$pkgs" ]]; then
printf 'The application %s is not installed. It may be found in the following packages:\n' "$cmd"
printf ' %s\n' $pkgs[@]
setopt shwordsplit
pkg_array=($pkgs[@])
pkgname="${${(@s:/:)pkg_array}[2]}"
printf 'Do you want to Install package %s? (y/N) ' $pkgname
if read -q "choice? "; then
echo
echo "Executing command: pacman -S $pkgname"
sudo pacman -S $pkgname
else
echo " "
fi
else
printf 'zsh: command not found: %s\n' "$cmd"
fi 1>&2
return 127
}
# Git logs
gitlog() {
setterm -linewrap off
git --no-pager log --all --color=always --graph --abbrev-commit --decorate \
--format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' | \
sed -E \
-e 's/\|(\x1b\[[0-9;]*m)+\\(\x1b\[[0-9;]*m)+ /├\1─╮\2/' \
-e 's/(\x1b\[[0-9;]+m)\|\x1b\[m\1\/\x1b\[m /\1├─╯\x1b\[m/' \
-e 's/\|(\x1b\[[0-9;]*m)+\\(\x1b\[[0-9;]*m)+/├\1╮\2/' \
-e 's/(\x1b\[[0-9;]+m)\|\x1b\[m\1\/\x1b\[m/\1├╯\x1b\[m/' \
-e 's/╮(\x1b\[[0-9;]*m)+\\/╮\1╰╮/' \
-e 's/╯(\x1b\[[0-9;]*m)+\//╯\1╭╯/' \
-e 's/(\||\\)\x1b\[m (\x1b\[[0-9;]*m)/╰╮\2/' \
-e 's/(\x1b\[[0-9;]*m)\\/\1╮/g' \
-e 's/(\x1b\[[0-9;]*m)\//\1╯/g' \
-e 's/^\*|(\x1b\[m )\*/\1⎬/g' \
-e 's/(\x1b\[[0-9;]*m)\|/\1│/g' | command less -r +'/[^/]HEAD'
setterm -linewrap on
}
# Load nvm
source /usr/share/nvm/init-nvm.sh
# Make GPG work in WSL
export GPG_TTY=$(tty)
# Enable fuck
eval $(thefuck --alias)
# Set starship Prompt
eval "$(starship init zsh)"
# Gay Neofetch
hyfetch