A comprehensive dotfiles configuration for macOS that provides a streamlined development environment with intelligent shell configuration, macOS system optimizations, and useful utilities.
- Multi-shell support: Works with Bash, Zsh, and Fish
- Smart prompts: Shows git status, error codes, and branch information
- Enhanced history: Improved history management with deduplication and search
- Auto-completion: Intelligent tab completion and suggestions
- Auto-updates: Automatically pulls latest dotfiles updates in background
- Git configuration: Useful aliases, LFS support, and smart defaults
- Vim setup: Feature-rich vim configuration with SpaceVim support
- Command line utilities: Custom scripts for common development tasks
- GPU management: Utilities for CUDA device selection
- Safe deletion:
trashcommand that moves files to Trash instead of permanent deletion - Package management: Auto-installation of development tools (asdf, zsh plugins)
- AI assistant: Built-in natural language to bash command translator
- Build tools: Deployment and export utilities
- System preferences: Comprehensive macOS tweaks for better UX
- Finder enhancements: Show hidden files, path bar, status bar
- Dock optimizations: Auto-hide, better animations, reduced clutter
- Keyboard improvements: Faster key repeat, disabled autocorrect for coding
- Performance tweaks: Optimized scrollbars, animations, and system behavior
-
Clone the repository:
git clone https://github.com/your-username/dotfiles.git ~/dotfiles cd ~/dotfiles
-
Source the configuration:
echo 'source $HOME/dotfiles/shellrc' >> ~/.bashrc # For Bash echo 'source $HOME/dotfiles/shellrc' >> ~/.zshrc # For Zsh
-
Personalize the configuration:
# Update your name and email in gitconfig nano ~/dotfiles/gitconfig
-
Apply macOS settings (optional):
./macos
The dotfiles will automatically:
- Add the
bindirectory to your PATH - Set up git configuration
- Deploy vim/SpaceVim configuration
- Install zsh plugins if using zsh
- Check for updates in the background
The dotfiles automatically check for updates when you open a new shell session. Updates are pulled in the background and you'll be notified if new changes are available.
To manually update:
cd ~/dotfiles && git pulldotfiles/
βββ bin/ # Utility scripts
β βββ deploy_dotfiles # Setup and deployment
β βββ bootstrap # Install development tools
β βββ my_copilot.py # AI bash translator
β βββ trash # Safe file deletion
β βββ ... # More utilities
βββ space_vim_config/ # SpaceVim configuration
βββ aliases # Command aliases
βββ common_config.fish # Fish shell config
βββ gitconfig # Git configuration
βββ inputrc # Readline configuration
βββ macos # macOS system preferences
βββ shellrc # Main shell configuration
βββ vimrc # Vim configuration
The intelligent prompt shows:
- Green arrow (β): Last command succeeded
- Red exclamation (!n): Last command failed with exit code n
- Git branch: Current branch name with dirty state indicator (
β οΈ ) - Hostname and current directory
# Navigation
.. # cd ..
... # cd ../..
.... # cd ../../..
# File operations
ll # ls -lh (detailed list)
la # ls -a (show hidden)
rm # trash (safe deletion)
# System monitoring
psmem # Top memory-consuming processes
pscpu # Top CPU-consuming processes
meminfo # Memory usage information
# Development
gpu0 # Set CUDA_VISIBLE_DEVICES=0
sact # source .venv/bin/activate
json # Pretty-print JSON with jqgit st # status -s (short status)
git cm # commit -m
git acm # add . && commit -m
git acp # add . && commit -m "update" && push
git lg # Pretty log with graph
git amend # Amend last commitbootstrap zsh # Install zsh plugins
bootstrap spacevim # Install SpaceVim
bootstrap asdf # Install asdf version manager
bootstrap x_cmd # Install x-cmd toolkitTranslates natural language to bash commands using AI:
= "create a tar archive of project folder"
# Output: tar -czvf project.tar.gz projectcopilot is a two-layer tool: bin/my_copilot.py is a neutral Gemini engine that simply accepts a prompt (--prompt or --prompt-file), shows a small spinner, and emits the raw completion. bin/copilot is the dispatcher that builds persona-specific prompts, feeds them to the engine, and routes the result to the right user-facing flow.
Examples:
copilot bash "find all .txt files and delete them"
copilot commit -s "Fix spinner" -d "Guard against mode-specific assumptions"The commit flow opens $EDITOR with the generated message before calling git commit -F when you save.
this is aliased to rm
trash file.txt # Move to ~/.Trash instead of permanent deletion
trash *.log # Move multiple files safely
rm file.txt # rm is aliased to trash, so it will move thing to trash
/bin/rm file.txt # use the system /bin/rm explicitly to actually removeBefore using certain features, set up these environment variables:
GOOGLE_API_KEY: Required for the AI copilot functionality (get from Google Cloud Console)MAKE: Automatically set tomake -j16for parallel builds
Add to your shell profile:
export GOOGLE_API_KEY="your-google-api-key-here"Important: Before using these dotfiles, update your personal information:
# Edit gitconfig and replace placeholder values
nano ~/dotfiles/gitconfig
# Update:
# name = Your Name β name = Your Actual Name
# email = your.email@example.com β email = your.actual@email.com- Shell prompt: Modify
git_info()andprecmd()functions inshellrc - Aliases: Add custom aliases to the
aliasesfile - macOS settings: Customize system preferences in the
macosscript
For Fish shell users, source the Fish configuration:
# Add to ~/.config/fish/config.fish
source ~/dotfiles/common_config.fishThe macos script includes optimizations for:
- Keyboard: Fast key repeat, disabled autocorrect
- Finder: Show hidden files, extensions, path bar
- Dock: Auto-hide, better animations, removed recent apps
- System: Disabled transparency, faster animations
- Security: Secure keyboard entry in Terminal
Run with: ./macos (requires admin password)
Manual settings:
- Input method
- Modifier key
Recommended Apps:
Rectangle
Hapigo brew install --cask hapigo
Feel free to:
- Fork this repository
- Add your own customizations
- Submit pull requests for useful features
- Report issues or suggest improvements
This dotfiles configuration is open source and available under the MIT License.
Note: Some features are macOS-specific. The shell configuration and utilities work on other Unix-like systems, but the macos script should only be run on macOS.