zsh config
This commit is contained in:
123
zsh/.zshrc
Normal file
123
zsh/.zshrc
Normal file
@@ -0,0 +1,123 @@
|
||||
# NO FUCKING BEEP
|
||||
unsetopt BEEP
|
||||
|
||||
# Run pywal only on WSL
|
||||
if grep -qE "(Microsoft|WSL)" /proc/version &> /dev/null && [ -z "$TMUX" ]; then
|
||||
cat ~/.cache/wal/sequences
|
||||
clear
|
||||
fi
|
||||
|
||||
# hledger
|
||||
export LEDGER_FILE=~/ExoKortex/2-Areas/Finances/finance_vault/tpouplier.hledger
|
||||
|
||||
# emacs client
|
||||
alias emacs="emacsclient -c -a emacs"
|
||||
|
||||
# Opencode
|
||||
alias oc="opencode"
|
||||
|
||||
# Yazi
|
||||
alias y="yazi"
|
||||
function yy() {
|
||||
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")"
|
||||
yazi "$@" --cwd-file="$tmp"
|
||||
if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
|
||||
cd -- "$cwd"
|
||||
fi
|
||||
rm -f -- "$tmp"
|
||||
}
|
||||
|
||||
# nvim
|
||||
export LANG=en_CA.UTF-8
|
||||
export LC_ALL=en_CA.UTF-8
|
||||
export EDITOR="nvim"
|
||||
|
||||
# Set up fzf key bindings and fuzzy completion
|
||||
source <(fzf --zsh)
|
||||
|
||||
# Capitalization fixing in tab completion
|
||||
autoload -Uz compinit && compinit
|
||||
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
|
||||
|
||||
# bat
|
||||
alias cat=bat
|
||||
|
||||
# aichat
|
||||
alias ai="aichat"
|
||||
alias aido="aichat -e"
|
||||
aitts() {
|
||||
paplay --raw --rate=22050 --format=s16le --channels=1 <(aichat "Answer only with speech. Your answer will be read outlound. No title, no bold or no special character. Only the short and direct answer. $*" | piper-tts --model en_US-amy-medium.onnx --output-raw)
|
||||
}
|
||||
# tmux
|
||||
alias t='tmux attach || tmux new'
|
||||
|
||||
# Docker
|
||||
alias dco="docker compose"
|
||||
alias dps="docker ps"
|
||||
alias dpa="docker ps -a"
|
||||
alias dl="docker ps -l -q"
|
||||
alias dx="docker exec -it"
|
||||
|
||||
# cd
|
||||
alias ..="cd .."
|
||||
alias ...="cd ../.."
|
||||
alias ....="cd ../../.."
|
||||
alias .....="cd ../../../.."
|
||||
alias ......="cd ../../../../.."
|
||||
|
||||
# Git
|
||||
alias gc="git commit -m"
|
||||
alias gca="git commit -a -m"
|
||||
alias gp="git push origin HEAD"
|
||||
alias gpu="git pull origin"
|
||||
alias gst="git status"
|
||||
alias glog="git log --graph --topo-order --pretty='%w(100,0,6)%C(yellow)%h%C(bold)%C(black)%d %C(cyan)%ar %C(green)%an%n%C(bold)%C(white)%s %N' --abbrev-commit"
|
||||
alias gdiff="git diff"
|
||||
alias gco="git checkout"
|
||||
alias gb='git branch'
|
||||
alias gba='git branch -a'
|
||||
alias gadd='git add'
|
||||
alias ga='git add -p'
|
||||
alias gcoall='git checkout -- .'
|
||||
alias gr='git remote'
|
||||
alias gre='git reset'
|
||||
alias gcl='git clone'
|
||||
|
||||
# lazygit
|
||||
alias lg="lazygit"
|
||||
|
||||
# NVIM
|
||||
alias v="nvim"
|
||||
|
||||
# Eza
|
||||
alias l="eza -l --icons --git -a"
|
||||
alias lt="eza --tree --level=2 --icons --git"
|
||||
alias ltree="eza --tree --level=2 --long --icons --git"
|
||||
|
||||
# navigation
|
||||
function cx() { cd "$@" && l; }
|
||||
function fcd() { cd "$(find . -type d -not -path '' | fzf)" && l; }
|
||||
#function f() { echo "$(find . -type f -not -path '*/.*' | fzf)" | pbcopy }
|
||||
function fv() { nvim "$(find . -type f -not -path '*/.*' | fzf)" }
|
||||
|
||||
# Command history
|
||||
HISTFILE=~/.zsh_history
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
setopt appendhistory
|
||||
|
||||
# Starship
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
# Zoxide
|
||||
eval "$(zoxide init zsh)"
|
||||
|
||||
# hyprshot
|
||||
export HYPRSHOT_DIR="Images"
|
||||
|
||||
# direnv
|
||||
# eval "$(direnv hook zsh)"
|
||||
|
||||
# Atuin
|
||||
#eval "$(atuin init zsh)"
|
||||
|
||||
Reference in New Issue
Block a user