18 days ago
My zsh config
Here's a breakdown of my .zshrc
file, explaining each alias, export, and function to help you understand how I’ve customized my terminal workflow.
Aliases
Aliases simplify repetitive commands, saving time and effort. Here are the ones I’ve configured:
1. YOLO Git Commit
alias yolo='git add . && git commit -m "YOLO commit" && git push origin main'
git add .
).main
branch.2. TypeScript YOLO Commit
alias tsyolo='npx tsc && git add . && git commit -m "YOLO commit" && git push origin main'
npx tsc
).yolo
alias.3. Edit .zshrc
alias zedit='cursor ~/.zshrc'
.zshrc
file in the editor.cursor
(replace with your preferred editor if necessary).4. Reload .zshrc
alias zsource='source ~/.zshrc'
.zshrc
file, applying any changes.5. Kill Process on Port 3000
alias kill3000="lsof -t -i :3000 | xargs kill -9"
lsof -t -i :3000
).kill -9
).6. Download YouTube Videos
alias download-youtube="node /Volumes/SSD/scripts/youtube-downloader-communicator/add-video.js"
Exports
Exports modify the environment variables for enhanced functionality.
1. Prevent Homebrew Cleanup
export HOMEBREW_NO_INSTALL_CLEANUP=1
2. Adjust PATH
export PATH="/opt/homebrew/bin:$PATH"
/opt/homebrew/bin
to the front of the PATH.Functions
Functions are more flexible than aliases and allow more complex behavior.
1. Find an Alias
aliasfinder() {alias | fzf --preview="echo {} | cut -d'=' -f2-" --height=20 --border --preview-window=down:3:wrap}
fzf
(fuzzy finder).2. Restart Docker Containers
alias docker-restart='docker compose down && docker compose up -d'
docker compose down
).docker compose up -d
).These customizations make my workflow smoother, enabling quick actions and saving me from repetitive typing. Feel free to adapt these commands to your own .zshrc
and optimize your terminal experience!