This is my development environment. There are many like it, but this one is mine.
Modern dotfiles for Git, Bash, Zsh, tmux, Vim, and VS Code. Works on macOS (with Homebrew), Linux, WSL (Windows Subsystem for Linux), and GitHub Codespaces.
- Key Features
- Supported Platforms
- Quick Start
- Requirements
- Core Configuration
- Optional Setup
- Advanced Features
- Customization
- Guides
- License
- Easy Python virtual environment management - One
venvcommand to activate, deactivate, or create.venvdirectories - Seamless GitHub account switching - Manage unlimited GitHub accounts with
gh-setup, switch between them instantly withgh-{name}commands - Works with both Bash and Zsh - Identical feature set and shared functions across both shells, choose your preference
- Highly usable Vim configuration - Sensible defaults, relative line numbers, persistent undo, system clipboard integration, and comprehensive inline documentation
- macOS - Full support with Homebrew package management
- Linux - Native support (tested on Ubuntu/Debian)
- WSL - Windows Subsystem for Linux with Windows VS Code integration
- GitHub Codespaces - Automatic installation via dotfiles integration
- Dev Containers - VS Code extensions automatically installed
One-line install:
curl -fsSL https://raw.githubusercontent.com/rafeco/dotfiles/main/bootstrap.sh | bashOr clone manually:
git clone https://github.com/rafeco/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
./install.shThe installer will symlink configs from home/* to ~/.*, backup existing files, and detect your environment (macOS/Linux/Codespaces).
After installation, optionally install recommended packages:
macOS:
~/.dotfiles/brew-setupUbuntu/Debian:
~/.dotfiles/ubuntu-setupSee Package Management for details.
Minimum requirements:
macOS:
brew install git tmux vimUbuntu/Debian/WSL:
sudo apt install git tmux vimGit is required; tmux and vim are optional.
Both shells share the same feature set through common functions defined in ~/.shell_functions.
Bash (home/bashrc)
- Smart history (10k entries, no duplicates)
- Git-aware prompt with branch display
- Starship prompt support (if installed)
- Platform-specific aliases and PATH configuration
Zsh (home/zshrc)
- All Bash features plus zsh enhancements
- Menu-style auto-completion
- Auto-cd, directory stack (
d,1,2) - Arrow key history search
- Plugin support (zsh-autosuggestions, zsh-syntax-highlighting)
Common Aliases:
- File operations:
ll,la,l,..,...,.... - Git shortcuts:
gs,ga,gc,gd,gl,gp,gpl - Safety:
rm -i,cp -i,mv -i - Ubuntu aliases:
bat→batcat,fd→fdfind
Common Functions:
mkcd- Create and enter a directoryextract- Smart archive extractionpsgrep- Search running processessearch- Find files and contentvenv- Python virtual environment management
Configuration in home/gitconfig:
- Default branch:
main - Auto-rebase on pull with autostash
- Histogram diff, zdiff3 merge conflicts
- Platform-specific credential helper via
.gitconfig.platform - Useful aliases:
lg- Pretty graph logs- Statusup- Pull with rebasesw/swc- Switch branchesamend- Amend last commit
Use ~/.gitconfig.local for personal overrides (automatically included, never touched by installer).
Configuration in home/tmux.conf:
- Prefix:
Ctrl-\ - Mouse support enabled
- Vi copy mode
- Intuitive splits:
|vertical,-horizontal - Vim-style pane navigation:
h/j/k/l - 50k line scrollback history
- 256 color support
Configuration in home/vimrc:
- Relative line numbers
- Mouse support
- Persistent undo (survives across sessions)
- System clipboard integration
- Per-language indentation (2/4 spaces)
- Auto-trim trailing whitespace
- True color support
- Comprehensive inline documentation
Interactive scripts to install recommended development tools.
macOS - Homebrew:
~/.dotfiles/brew-setupUbuntu/Debian - APT:
~/.dotfiles/ubuntu-setupBoth scripts:
- Scan your system to show which packages are already installed
- List missing packages with clear categorization
- Confirm before installing anything
- Handle installation failures gracefully
Packages installed:
GNU Core Utilities (macOS compatibility layer)
bash- Modern Bash shell (macOS ships with ancient version)coreutils,grep,gnu-sed,gawk,findutils,diffutils
Zsh Enhancements
zsh-syntax-highlighting- Fish-like syntax highlightingzsh-autosuggestions- Fish-like command suggestionszsh-completions- Additional completion definitions
Development & Productivity
git,gh- Version control and GitHub CLIjq- JSON processorfzf- Fuzzy finderripgrep,fd- Fast search toolsbat- cat with syntax highlightingeza- Modern ls replacementtldr- Simplified man pageshtop,tree,wget,watch
Linting & Formatting
shellcheck- Shell script static analysisshfmt- Shell script formatter
Ubuntu-specific notes:
- Most GNU utilities are already installed by default
- Some packages have different command names:
fd-find→fdfind,bat→batcat(aliases included in dotfiles) - Special packages (
gh,eza,tldr,shfmt) require additional installation steps with instructions provided by the script
VS Code settings are managed separately from the main dotfiles installation:
~/.dotfiles/vscode-install.shPlatform detection:
- macOS/Linux: Symlinks settings files to VS Code's User directory
- WSL (Windows): Copies settings to Windows VS Code and installs extensions via
cmd.exe - Dev Containers: Extensions automatically installed via
.devcontainer/devcontainer.json
What's installed:
settings.json- Editor preferences (Vim keybindings, theme, formatting)keybindings.json- Custom keyboard shortcutssnippets/- Code snippets directory- Extensions from
extensions.txt:- Python development (debugpy, pylance, python)
- Vim emulation
- GitLens
- Prettier
- Error Lens
- Material Icon Theme
Note for WSL users: Settings are copied (not symlinked) to work across the WSL/Windows boundary. Re-run the installer after updating your dotfiles to sync changes.
Update extensions list:
code --list-extensions > ~/.dotfiles/vscode/extensions.txtSee vscode/README.md for more details.
The installer automatically installs Claude Code, Anthropic's AI coding CLI. After installation, claude is available in your terminal.
Both Bash and Zsh will automatically use Starship if it's installed, falling back to custom git-aware prompts otherwise.
# Install Starship (optional)
brew install starship
# Optional: Install a Nerd Font for icons
brew install font-fira-code-nerd-font
# Apply a preset or create custom config
starship preset nerd-font-symbols -o ~/.config/starship.tomlSmart virtual environment management with the venv command:
- Toggle activation/deactivation with a single command
- Automatically finds
.venvorvenvdirectories - Offers to create
.venvif none exists - Properly manages PATH to prioritize installed packages
Usage:
venv # Activate/deactivate venv in current directoryConfig-driven account management supporting unlimited GitHub accounts.
Commands:
gh-setup- Interactive wizard to add/edit/remove accounts- Shows list of configured accounts when removing
- Automatically reloads shell after saving changes
gh-{name}- Dynamic commands created for each configured account- Example:
gh-rafeco,gh-work,gh-client
- Example:
gh-whoami- Display current account status
Features:
- Automatically updates gh CLI and git user name/email
- Uses git config (INI) format for easy editing
- Configuration stored in
~/.gh-accounts(not tracked in git) - Template provided in
home/gh-accounts.example
Setup:
cp ~/.dotfiles/home/gh-accounts.example ~/.gh-accounts
# Edit ~/.gh-accounts to add your accounts
gh-setup # Or use interactive wizardEdit configuration files:
- Edit files in
home/directory - Re-run
./install.shto update symlinks
Personal Git settings:
- Use
~/.gitconfig.localfor personal Git overrides - Automatically included by main gitconfig
- Never touched by the installer
Shell customization:
- Edit
~/.bashrc.localor~/.zshrc.localfor personal shell settings (optional) - Shared functions can be extended in
~/.shell_functions.local(optional)
Detailed user guides for each tool, customized to this configuration:
- Shell Guide - Aliases, functions, key bindings, zsh features, GitHub account switching
- Vim Guide - Navigation, editing, splits, search, completion, per-language settings
- tmux Guide - Sessions, windows, panes, copy mode, mouse support
- CLI Tools Guide - Modern command replacements (
rg,fd,bat,eza,fzf) with usage examples
MIT