Modern development environment configuration for macOS.
# Finder
sudo defaults write com.apple.finder "AppleShowAllFiles" -bool "true"
sudo defaults write com.apple.finder "FXPreferredViewStyle" -string "Nlsv"
killall Finder# DNS config
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8xcode-select --install/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Official site: https://brew.sh/
For Apple Silicon Macs, add Homebrew to PATH:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"bash <<"EOF"
# Exit on error and print commands as they execute
set -ex
# Install core command-line packages
brew install \
1password-cli \
rg \
awscli \
fzf \
gh \
git \
htop \
libpq \
mas \
n \
neovim \
pipx \
poppler \
pyenv \
rbenv \
tmux \
uv \
wget \
xz \
zsh \
zsh-vi-mode
# Install GUI applications via Homebrew Cask
brew install --cask \
gitify \
gpg-suite \
google-chrome \
numi \
1password
# Install fonts
brew install --cask font-jetbrains-mono
brew install --cask font-fira-code-nerd-font
# Create symlink for psql command to use PostgreSQL client without full PostgreSQL install
# This makes psql available system-wide
brew link --force libpq
EOFNotes:
- Dockutil is outdated in homebrew, install it from https://github.com/kcrawford/dockutil
- Installs a newer version of rsync as the one in OSX is outdated and does not support parameters like
--chown
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"Install recommended plugins:
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting$(brew --prefix)/opt/fzf/install --key-bindings --completion --no-update-rcbash <<"EOF"
set -ex
mas install 937984704 # mas search amphetamine
mas install 585829637 # mas search todoist
mas install 803453959 # mas search slack
mas install 310633997 # mas search whatsapp
mas install 1569813296 # mas search "1Password for Safari"
EOFpipx ensurepathAdd to your shell configuration if not already present:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"Add to your shell configuration if not already present:
eval "$(rbenv init -)"-
Clone this repository:
git clone https://github.com/yourusername/dotfiles.git ~/Projects/dotfiles cd ~/Projects/dotfiles
-
Create CONFIG file:
cp CONFIG.example CONFIG
Edit
CONFIGif needed to adjust destination directory or ignored files. -
Preview symlinks (dry-run):
bin/create-symlinks --dry-run
-
Create symlinks:
bin/create-symlinks
.zshrc- Zsh configuration with oh-my-zsh- Plugins: git, zsh-autosuggestions, zsh-syntax-highlighting, fzf, history, docker, npm
- Python virtualenv auto-activation
- Enhanced history management
.config/nvim/- Neovim configuration- lazy.nvim plugin manager
- GitHub Copilot integration
- FZF fuzzy finding
- NERDTree file explorer
- Language support (Python, Ruby, Node.js)
.tmux.conf- Tmux configuration- Mouse support enabled
- Vi-mode key bindings
- Custom key bindings for pane management
- 256 color support
.gitconfig- Git user configuration and aliases.config/git/ignore- Global gitignore patterns
.bashrc- Minimal bash configuration.psqlrc- PostgreSQL client configuration
Plugins will be automatically installed when you first open Neovim with lazy.nvim.
Alternatively, open Neovim and run:
:Lazy syncAllow 1Password CLI to use 1Password Desktop for authentication:
- Open 1Password
- Settings > Developer
- Enable Integrate with 1Password CLI
- Open the GPG Keychain
- Find for "GPG Key" in 1password
- Click to view the document, and then Show in Finder
- Drag and drop to GPG Keychain
n ltsGenerate a new authentication key:
instructions adapted from https://gist.github.com/mcattarinussi/834fc4b641ff4572018d0c665e5a94d3
- Generate new key (find fingerprint with
gpg --list-keys)
gpg --quick-add-key [FINGERPRINT] rsa sign,auth 1y
gpg --list-secret-keys --keyid-format=long --with-keygrip- Add new key to sshcontrol
echo [KEYGRIP] >> ~/.gnupg/sshcontrol
ssh-add -l- Export SSH key and add to GitHub
https://github.com/settings/keys
gpg --export-ssh-key me@felipet.io >! ~/.ssh/id_rsa.pub && chmod 0600 ~/.ssh/id_rsa.pub- Test connection
echo UPDATESTARTUPTTY | gpg-connect-agent
ssh -vT git@github.comConfiguring the signing key:
gpg --list-secret-keys --keyid-format=long
git config --global user.signingkey [SIGNING KEY]The symlink script is controlled by the CONFIG file:
cfg_ignore- Files/directories to skipcfg_first_child- Directories to symlink children (e.g.,.config)cfg_dest_dir- Destination directory (usually$HOME)cfg_dotfiles_relative_path- Path to dotfiles repo (relative to dest_dir)
Thanks to https://github.com/sitaktif for the symlink script inspiration!