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

111 lines
2.9 KiB
Bash
Raw Permalink Normal View History

2022-07-11 13:18:31 +00:00
# Set PATH
2022-09-12 19:33:34 +00:00
export PATH=$PATH:$HOME/.spicetify:/opt/cuda/bin
2022-07-11 13:18:31 +00:00
2021-12-28 05:04:49 +00:00
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# omz configs
2022-09-12 19:33:34 +00:00
HYPHEN_INSENSITIVE=true
UPDATE_ZSH_DAYS=7
ENABLE_CORRECTION=true
COMPLETION_WAITING_DOTS=true
2021-12-28 05:04:49 +00:00
# Plugins
2022-10-25 06:20:26 +00:00
plugins=(zsh-history-substring-search zsh-autosuggestions bgnotify colored-man-pages nvm rust docker docker-compose dotnet zsh-syntax-highlighting)
2021-12-28 05:04:49 +00:00
# Plugin Configs
2022-09-12 19:33:34 +00:00
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor root line)
2022-11-17 19:49:31 +00:00
zstyle ':omz:plugins:nvm' autoload true
2021-12-28 05:04:49 +00:00
2022-10-25 06:20:26 +00:00
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
2021-12-28 05:04:49 +00:00
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"
2022-08-02 02:59:13 +00:00
alias neofetch="hyfetch"
2021-12-28 05:04:49 +00:00
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
2022-06-23 09:07:52 +00:00
# Make GPG work in WSL
export GPG_TTY=$(tty)
# Enable fuck
eval $(thefuck --alias)
2022-01-09 05:28:34 +00:00
# Set starship Prompt
eval "$(starship init zsh)"
2022-09-12 19:33:34 +00:00
# Gay Neofetch
2022-08-02 02:59:13 +00:00
hyfetch