Skip to content

andrew-sameh/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles

Personal dotfiles managed with GNU Stow for macOS. These configurations are user and machine-agnostic, using $HOME environment variable for portability.

Prerequisites

# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Stow
brew install stow

Quick Start

  1. Clone this repository:

    git clone https://github.com/yourusername/dotfiles.git ~/dotfiles
    cd ~/dotfiles
  2. Install applications via Homebrew:

    brew bundle --file=_brew/Brewfile
  3. Stow the configurations you want:

    # Stow individual packages
    stow zsh
    stow nvim
    stow tmux
    
    # Or stow everything at once
    stow */

What's Included

Shell & Terminal

  • zsh - Shell configuration with aliases, functions, and environment setup
  • starship - Cross-shell prompt configuration
  • tmux - Terminal multiplexer configuration
  • ghostty - Terminal emulator settings
  • warp - Modern terminal configuration

Development Tools

  • nvim - Neovim configuration with LazyVim
  • git - Git configuration and aliases
  • lazygit - Terminal UI for git commands
  • ssh - SSH client configuration

Editors & IDEs

  • vscode - VS Code settings and keybindings
  • cursor - Cursor IDE configuration
  • antigravity - Antigravity editor settings
  • zed - Zed editor configuration

Utilities

  • yazi - Terminal file manager
  • nap - Code snippet manager
  • neofetch - System information tool
  • rectangle - Window management
  • aerospace - Tiling window manager

Language-Specific

  • poetry - Python dependency management configuration

Stow Commands

Basic Usage

# Stow a single package (creates symlinks)
stow <package-name>

# Examples:
stow zsh        # Link zsh configs to $HOME
stow nvim       # Link nvim configs to $HOME/.config/nvim
stow git        # Link git configs to $HOME

# Stow multiple packages at once
stow zsh nvim tmux git

# Stow all packages (use with caution)
stow */

Removing/Unstowing

# Remove symlinks for a package
stow -D <package-name>

# Examples:
stow -D zsh     # Remove zsh symlinks
stow -D nvim    # Remove nvim symlinks

# Unstow all packages
stow -D */

Restowing (Update symlinks)

# Useful after updating configs - removes old and creates new symlinks
stow -R <package-name>

# Examples:
stow -R zsh
stow -R nvim

# Restow everything
stow -R */

Dry Run (Preview changes)

# See what would happen without actually doing it
stow -n <package-name>
stow -nv <package-name>  # Verbose output

# Examples:
stow -nv zsh    # Preview zsh stow operation
stow -nv */     # Preview stowing all packages

Advanced Options

# Specify a different target directory (default: $HOME via .stowrc)
stow --target=/some/other/path <package-name>

# Verbose output (see what's being linked)
stow -v <package-name>

# Simulate (dry-run) with verbose output
stow -nv <package-name>

# Adopt existing files (move them into stow package)
stow --adopt <package-name>

Machine-Specific Configurations

Some configurations may need to be machine-specific. Here's how to handle them:

Strategy 1: Separate Stow Packages

Create machine-specific packages:

dotfiles/
├── tmux/              # Shared tmux config
├── tmux-work/         # Work machine specific
└── tmux-personal/     # Personal machine specific

Then stow the appropriate one:

# On work machine
stow tmux tmux-work

# On personal machine
stow tmux tmux-personal

Strategy 2: Hostname-Based Conditionals

Use hostname detection in config files:

# In .zshrc or .tmux.conf
if [ "$(hostname)" = "work-machine" ]; then
    # Work-specific settings
else
    # Personal settings
fi

Strategy 3: Separate Config Files

Keep a base config that sources machine-specific overrides:

# In .tmux.conf
source-file ~/.tmux.conf.$(hostname)

Then create:

  • .tmux.conf.work-machine
  • .tmux.conf.personal-machine

Directory Structure

Each directory represents a "stow package" and mirrors the structure from $HOME:

dotfiles/
├── zsh/
│   ├── .zshrc           → $HOME/.zshrc
│   └── .zprofile        → $HOME/.zprofile
├── nvim/
│   └── .config/
│       └── nvim/        → $HOME/.config/nvim/
├── tmux/
│   └── .tmux.conf       → $HOME/.tmux.conf
└── git/
    └── .gitconfig       → $HOME/.gitconfig

Configuration Notes

Git Configuration

Update git/.gitconfig with your personal information:

[user]
    name = Your Name
    email = [email protected]

Zsh Configuration

After stowing zsh configs:

# Reload shell configuration
source ~/.zshrc

# Or restart your terminal

SSH Keys

The ssh/ directory contains SSH client configuration. Your actual SSH keys should be managed separately and NOT committed to the repository.

Updating Dotfiles

# Navigate to dotfiles directory
cd ~/dotfiles

# Pull latest changes
git pull

# Restow updated packages
stow -R <package-name>

# Or restow everything
stow -R */

Backup Your Existing Configs

Before stowing, backup your existing configurations:

# Create backup directory
mkdir -p ~/.config-backup

# Backup existing configs
cp ~/.zshrc ~/.config-backup/
cp -r ~/.config/nvim ~/.config-backup/
# ... backup other configs as needed

Troubleshooting

Conflicts

If stow reports conflicts (existing files/symlinks):

# Option 1: Remove/backup the conflicting file manually
mv ~/.zshrc ~/.zshrc.backup

# Option 2: Use --adopt to move existing file into stow package
stow --adopt zsh

# Option 3: Force removal (careful!)
stow -D zsh  # Remove old symlinks
rm ~/.zshrc  # Remove conflicting file
stow zsh     # Create new symlinks

Broken Symlinks

# Find broken symlinks in home directory
find ~ -maxdepth 1 -type l ! -exec test -e {} \; -print

# Remove broken symlink
rm <broken-symlink>

# Restow the package
stow -R <package-name>

Check What's Stowed

# List all symlinks in your home directory
ls -la ~ | grep "^l"

# See where a specific config links to
ls -la ~/.zshrc

Managing Homebrew Packages

Export Current Packages

cd ~/dotfiles
brew bundle dump --force --describe --file=_brew/Brewfile

Install Packages from Brewfile

cd ~/dotfiles
brew bundle --file=_brew/Brewfile

Cleanup Unused Packages

# Remove packages not listed in Brewfile
brew bundle cleanup --file=_brew/Brewfile

# Do a dry run first
brew bundle cleanup --file=_brew/Brewfile --dry-run

Contributing

This is a personal dotfiles repository, but feel free to fork it and adapt it to your needs!

Resources

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published