A collection of configuration files for various tools and shells.
Before installing, ensure you have the following installed:
- Zsh: Most modern systems have this by default.
- Oh My Zsh: Required for the Zsh configuration. Install it via:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" - Git: Required for cloning the repository and many aliases.
To get the most out of the Zsh configuration, install these plugins via Homebrew:
brew install zsh-autosuggestions zsh-syntax-highlighting- Shell Configurations: ZSH and Bash configurations with useful aliases and functions
- Git Configuration: Aliases, colors, and useful defaults
- Tmux Configuration: Custom keybindings and status bar
- Ruby Configuration: Gem settings
- Cross-platform Support: Works on macOS and Linux
- DRY Configuration: Shared configuration between Bash and Zsh
The following core tools are available in both Zsh and Bash:
sysinfo: Display a colorful summary of system hardware, OS, and network info.mkcd [dir]: Create a new directory and immediately change into it.extract [file]: Smart extraction for almost any compressed file format (zip, tar.gz, rar, 7z, etc.).server [port]: Start a quick HTTP server in the current directory (defaults to port 8000).ll/la: Improved directory listings with color and detail.- Git Shortcuts:
gs(status),gc(commit),gp(push),gl(pull),gd(diff).
Custom bindings for a more efficient workflow:
Ctrl-b + r: Reload the tmux configuration.Ctrl-b + h/j/k/l: Move between panes using Vim-style keys (Left, Down, Up, Right).
.dotfiles/
├── bash/ # Bash-specific configuration files
├── bin/ # Executable scripts
├── git/ # Git configuration files
├── ruby/ # Ruby configuration files
├── shell/ # Shared shell configurations
│ ├── common/ # Common configuration files for all shells
│ │ ├── aliases.sh # Common aliases
│ │ ├── exports.sh # Common environment variables
│ │ ├── functions.sh # Common shell functions
│ │ └── path.sh # Common PATH setup
│ ├── bash_specific.sh # Bash-specific settings
│ └── zsh_specific.sh # Zsh-specific settings
├── tmux/ # Tmux configuration files
├── zsh/ # ZSH-specific configuration files (with leading dots)
├── install.sh # Installation script
└── README.md # This file
git clone https://github.com/beol/dotfiles.git ~/.dotfiles
cd ~/.dotfiles./install.shThis will:
- Create symbolic links for all configuration files
- Backup any existing configuration files
- Detect your OS and create the appropriate links
If you prefer to create the symlinks manually, you can do so with the following commands:
# ZSH - only need to symlink .zshenv since it sets ZDOTDIR
ln -s ~/.dotfiles/zsh/.zshenv ~/.zshenv
# No need for these symlinks as zsh will find them in $ZDOTDIR:
# ln -s ~/.dotfiles/zsh/.zshrc ~/.zshrc
# ln -s ~/.dotfiles/zsh/.zprofile ~/.zprofile
# Git
ln -s ~/.dotfiles/git/gitconfig ~/.gitconfig
ln -s ~/.dotfiles/git/gitignore ~/.gitignore
# Ruby
ln -s ~/.dotfiles/ruby/gemrc ~/.gemrc
# Tmux
ln -s ~/.dotfiles/tmux/tmux.conf ~/.tmux.conf
# Bash (macOS)
ln -s ~/.dotfiles/bash/bash_profile ~/.bash_profile
ln -s ~/.dotfiles/bash/bashrc ~/.bashrc
ln -s ~/.dotfiles/bash/inputrc ~/.inputrc
# Bash (Linux)
ln -s ~/.dotfiles/bash/bashrc ~/.bashrc
ln -s ~/.dotfiles/bash/inputrc ~/.inputrcThe repository uses a DRY (Don't Repeat Yourself) approach to shell configuration:
-
Common Files: Located in
shell/common/directory, these files are sourced by both Bash and Zsh:path.sh: PATH setup, including Homebrew paths with architecture detectionexports.sh: Common environment variablesaliases.sh: Common command aliasesfunctions.sh: Useful shell functions
-
Shell-Specific Files: Located in the
shell/directory:bash_specific.sh: Bash-specific settings (prompt, completion, etc.)zsh_specific.sh: Zsh-specific settings (Oh My Zsh, plugins, etc.)
-
Loading Order:
graph TD
subgraph Zsh ["Zsh Loading Flow"]
ZEnv["~/.zshenv"] -->|Sets ZDOTDIR| ZDir{ZDOTDIR}
ZDir --> ZProf["$ZDOTDIR/.zprofile"]
ZDir --> ZRc["$ZDOTDIR/.zshrc"]
ZProf -->|Sources| Common[Common Configs]
ZRc -->|Sources| ZSpecific[Zsh Specific]
end
subgraph Bash ["Bash Loading Flow"]
BProf["~/.bash_profile"] -->|Sources| BRc["~/.bashrc"]
BRc -->|Sources| Common
BRc -->|Sources| BSpecific[Bash Specific]
end
- Machine-specific Git: Create a
~/.gitconfig.localfile, which will be included automatically - Shell Functions: Add your own functions to the common functions file
- Aliases: Add your own aliases to the common aliases file
Machine-specific configuration that should never be committed lives in
~/.shell_local.sh. A template with examples is provided:
cp ~/.dotfiles/shell/local.template.sh ~/.shell_local.shUse it for LAN proxy URLs, work-specific PATH entries, project environment variables, and JVM heap overrides for machines with less than 4 GB RAM:
# Example: reduce JVM heap on a low-memory machine
export MAVEN_OPTS="-Xms512m -Xmx1024m"This file is loaded last (after all shared config) so its values always win.
The shared git/gitconfig intentionally has no [user] block. You must
set your name and email locally so they are never committed to this repo:
git config --file ~/.gitconfig.local user.name "Your Name"
git config --file ~/.gitconfig.local user.email "you@example.com"A starter template is provided at git/gitconfig.local.template.
If you use a corporate or home-lab root CA, set NODE_EXTRA_CA_CERTS in
~/.shell_local.sh so it stays off the shared dotfiles:
export NODE_EXTRA_CA_CERTS="$HOME/.dotfiles/MyRoot_CA.crt"Node.js picks up this variable automatically. If the variable is unset, Node.js uses its default trust store.
exports.sh sets SSH_AUTH_SOCK to the 1Password agent socket only when
both of the following are true:
- The OS is macOS (
uname -s= Darwin) - The socket file
~/.1password/agent.sockexists
If you do not use 1Password, no action is required — the conditional silently skips and your existing SSH agent is unaffected.
After making changes to your dotfiles, you can reload your shell environment:
- Zsh:
source ~/.zshrc - Bash:
source ~/.bashrc
The installation script creates a timestamped backup of your original configuration files in:
~/.dotfiles_backup/YYYYMMDD_HHMMSS/
To revert a change, simply copy the desired file back to your home directory.
If you encounter issues with Zsh completions, try clearing the completion cache:
rm -f ~/.zcompdump*
exec zsh