These are the command-line setup and configuration files I use for all my computers, stored on Github for easier sharing between computers and with other people.
- Inspired by dotfiles from Ryan Bates and thoughtbot.
Mostly stolenTweaked from Matt's dotfiles.- vim, tmux and zsh setup informed heavily by Trae's dotfiles
- Other utilities repurposed, tweaked or outright stolen from around the internet.
- macOS on Apple Silicon (ARM64) — Intel Macs are still supported but ARM is the primary target
- Xcode command line tools:
xcode-select --install - Homebrew installed natively at
/opt/homebrew(ARM) or/usr/local(Intel) — see Installation below - asdf for managing language runtimes (Ruby, Node) — installed via Homebrew as part of
rake install - The
highlinegem for the installation script:gem install highline
These dotfiles support both bash and zsh, with zsh (via oh my zsh) as the primary shell.
The default shell is /bin/zsh — the macOS system zsh, which is a universal binary that runs natively on both ARM and Intel. Homebrew-installed zsh is also supported but not required; note that Homebrew zsh at /usr/local/bin/zsh is x86_64 only and will run under Rosetta on Apple Silicon.
For oh my zsh setup:
- Install oh my zsh
Some features of the bashrc may work only with bash 4.2+ with bash-completion, which may not be installed by default on the Mac. These can be installed via Homebrew:
brew install bash bash-completion- Add
$HOMEBREW_PREFIX/bin/bashto/etc/shells - Change your shell to
$HOMEBREW_PREFIX/bin/bashby runningchsh
-
Shell configuration includes a supercharged prompt for both bash and zsh with ruby and git information, with help from the zsh-git-prompt and bash-git-prompt plugins. To tweak, change the configuration in
git-prompt-colors.shfor bash andoh-my-zsh-custom/themes/richa.zsh-themefor zsh. -
vi command mode is enabled by default in both bash and zsh. To switch back to the default emacs mode, remove the
set -o viline inbashrcand thevi-modeplugin fromzshrc.
-
Vim configuration with support for selected plugins, with plugin management by vim-plug. To use:
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim- If desired, tweak the font and color scheme settings. The default color scheme is PaperColor. The default font is Espresso Mono, a variant of DejaVu Sans Mono.
- Start vim
- Run
PlugInstallin command mode.
-
An
editshim will launchcode(Visual Studio Code) if you are on your local Mac, and fall back toviif you are logged in via ssh. This shim is used as the git editor and svn editor.
An r command serves as a shortcut for running bundle exec rake or bundle exec rails. It's pretty smart, so r s will expand to bundle exec rails server, and r db will expand to bundle exec rake db:console. No more fat-finger mistakes of rails vs rake!
-
This repo also comes with tmux configuration, for you terminal purists.
brew install tmuxis included in the Brewfile. -
Multi-monitor window management setup files are available for Hammerspoon:
- Download and install the latest release
- Tweak the configuration in
hammerspoon/init.luaas you like
-
Install Xcode command line tools:
xcode-select --install -
Install Homebrew natively for your architecture. On Apple Silicon, make sure to run the installer under native ARM — not Rosetta — by prefixing with
arch -arm64:arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"On Intel, just run the standard installer:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Clone this repo:
git clone git@github.com:ravasthi/dotfiles.git ~/Library/dotfiles cd ~/Library/dotfiles git submodule init git submodule update -
Install the
highlinegem:gem install highline -
Run the installer, which installs all Homebrew packages (via
Brewfile) and symlinks dotfiles into your home directory:rake install -
Change your default shell to
/bin/zsh:chsh -s /bin/zshOpen a new terminal window or tab to pick up the new shell.
