This is a repository of my MacOS dotfiles. Project is still a work in progress.
.profilebash/zsh profile.gitconfiggit configuration.gitignore_globala global git ignore
- Set zsh as your login shell.
- Install NVM (Node Version Manager) to manage Node.js and NPM versions.
Clone repo:
git clone git://github.com/terriann/dotfiles.git ~/.dotfiles(Or, fork and clone).
Install the dotfiles:
bash ~/.dotfiles/setup.shIf using the base Homebrew setup also run this script:
bash ~/.dotfiles/setup/brew.shThis command will create symlinks for config files in your home directory.
You will need to restart your terminal in order to make use of the changes.
You may need to add the following line to your ~/.zshrc in order for the aliases and settings to apply.
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
Create a .local copy of setting you don't want to publish. The configs will give higher precedence to private local settings named with a .local filename extension.
ex. ~/.dotfiles/<<CONFIG>>.local
Some sample local files are included, just rename the file to remove .sample
A setup file /setup/brew.sh will do a preliminary Homebrew setup. It includes a number of packages, commands, and helpful applications installed as casks.
git Configuration
- Enables git shell colors
| Command | Description |
|---|---|
git a |
Add files |
git aa |
Add all unstaged files |
git aliases |
List available aliases |
git amend |
Amend the last commit |
git br |
Run git branch |
git ci |
Commit all changes (git commit -a) |
git co |
Check out a branch |
git curb |
Show the current branch |
git graph |
Show recent history as a graph |
git last |
Show the last commit on the branch |
git lg |
Show log with relative dates and changed files |
git pushup |
Push branch and set upstream |
git reset |
Reset a file to HEAD |
git st |
Show status |
git unstage |
Unstage changes |
| Command | Description |
|---|---|
.. |
Go up one directory |
... |
Go up two directories |
~ |
Go to home directory |
mkdir |
Create directories as needed (no error if they exist) |
ll |
List files verbosely with human-readable sizes and colors |
ls |
List files in color, hide . and .. |
grep |
Highlight matches in color |
ps |
Show all processes |
catn |
Display file contents with line numbers |
These are the commands that trigger simple scripts or series of commands to yield a specific outcome.
| Alias | Description |
|---|---|
reload-profile |
Reload shell from ~/.profile |
clear-history |
Clear Zsh history |
brewup |
Update Homebrew, run housekeeping, report vulnerable packages |
npmup |
Update NPM and global packages with before/after diff |
nodeup |
Update Node.js to LTS (using NVM) and suggest global package reinstalls |
eject-all |
Eject all devices |
git-prune-branches |
Delete local branches merged into main after checkout |
| Alias | Description |
|---|---|
sublime |
Open file (or current working directory) in Sublime Text |
photoshop |
Open file (or current working directory) in Adobe Photoshop CS |
preview |
Open file (or current working directory) in Preview |
chrome |
Open file (or current working directory) in Google Chrome |
brave |
Open file (or current working directory) in Brave Browser |
safari |
Open file (or current working directory) in Safari |
finder |
Open file (or current working directory) in Finder |
code |
Use methodology built into app. See https://code.visualstudio.com/docs/setup/mac |
terminal |
Open current directory in a terminal window (handy inside Cursor/VS Code integrated terminal) |
| Alias | Description |
|---|---|
showdotfiles |
Make *. files visible throughout OS |
hidedotfiles |
Make *. files hidden throughout OS |
hidedeskicons |
Hide icons on desktop (good for presenting) |
showdeskicons |
Show icons on desktop |
unquarantine |
Removed xattr quarantine |
rmdropboxattr |
Removed xattr dropbox attributes |
stdchmod |
Applies standard chmod settings for directories (755) and files (644) |
| Alias | Command | Description |
|---|---|---|
flushdns |
dscacheutil -flushcache |
Flush DNS |
ip |
ifconfig | grep "inet " | grep -v 127.0.0.1 |
Simple IP information output |
ip1 |
ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1' |
More detailed IP information output |
ip2 |
curl -s "https://en.wordpress.com/whatismyip?" | awk "{print $1}" |
External IP information output |
Getting a prompt for Github username and password but I setup key:
Check this article to test your connection and authorize the key: Testing your SSH connection
Some of the resources I used and found while setting up configurations
- Customize Your Shell & Command Prompt - June 2012
- How to Make a Fancy and Useful Bash Prompt in Linux - May 2014
- Git Basics - Git Aliases - Documentation
- Github thoughtbot/dotfiles Repo
- Github yanyaoer/dotfile Repo
- Github holman/dotfile Repo
- Github ymendel/dotfile Repo
- Gist octocat/.gitignore
- 7 Git Hacks
- Github bear/bear - dotfiles, tools, notes and and config scripts
- /paulmillr/dotfiles
- Dotfile inspiration
- How to and Best of Homebrew - gist indiesquidge/homebrew.md
- Install most of my Apps with homebrew & cask
- How can I list and edit all defined aliases in Terminal? - stackoverflow - good for when you've taken your configuration too far down the rabbit hole and months later need to crawl back out.
- The macOS School of Terminal Witchcraft and Wizardry - Armin Briegel - Excellent presentation with LOADS of Terminal efficiency tips. Definitely worth a watch
- Better zsh history