Your dotfiles will help you create powerful and consistent shell shortcuts and functions, settings for your editors, color coding and layouts for your shell, preferences and authentication for ssh and mysql and other protocols, and more
If you’re not familiar with the concept of dotfiles, check out Github’s dotfiles page to learn more about them. Essentially, when someone says “dotfiles” they mean maintaining your command-line preferences in a Git repository (sort of like how I use Dropbox to manage my preference files for TextExpander, etc.) that you install on every computer.
The name dotfiles refers to the fact that most of the files that perform this sort of configuration start with a dot. The Zsh configuration file, for example, is
.zshrc The SSH configuration folder is
.ssh And so on. So the concept of “dotfiles” just means “versioning your configuration files.”
Your dotfiles will help you create powerful and consistent shell shortcuts and functions, settings for your editors, color coding and layouts for your shell, preferences and authentication for ssh and mysql and other protocols, and more.
Warning: If you want to give these dotfiles a try, you should first fork this repository, review the code, and remove things you don’t want or need. Don’t blindly use my settings unless you know what that entails. Use at your own risk!
Dotfiles are split into two main types. Those that contain a set of commands and only run once, .osx for example runs a list of commands and gives OS X super powers. Other files such as .bash_profile and .bashrc run each time you open a new Terminal session and gives your Terminal super powers.
Here’s a run down of the dotfiles in my repo and a description of what they can do.
When you open a new Terminal session, this file is loaded by Bash. It loads in the other dotfiles
path,bash_prompt,exports,aliases,functions,extra and configures some useful settings such as auto correcting typos when using cd completion.
In some instances
.bashrc can be loaded, so this file makes sure that .bash_profile is called.
This file speeds up the process of running executable files. Rather than having to cd back and forth across various paths to executable files, you can set the file paths in your .path dotilfe and then run executable files directly.
Generally, this file isn’t held in the public repo as it can contain sensitive information.
Here’s an example
~/.path file that adds
~/utils to the
$PATH: export PATH="$HOME/utils:$PATH"`
Using this file you can customise and set the various colors of your Bash prompt.
Sets environment variables, such as setting Vim as the default editor using export
EDITOR="sublime" It also increases the amount of history saved, useful for backtracking over previous commands you’ve used.
This file contains useful aliases to help you write less. For example, instead of typing
cd .. you can set it here to be ‘..’. Starting to like these files yet?
Similar to aliases, except functions can take arguments.
Before when I mentioned I was looking over different dotfile repos, I did mkdir to create a directory. After that, I’d then need to cd into that directory.
This file is only used by Git, for example, when a git command is invoked. So although there’s an
.aliases file, those aliases are run directly.
Set files that you’d like Git to ignore on the entire system. Yay, no more
.DS_Store being accidentally committed!
A small file that improves readability for gvim.
Simliar to .gitignore for Mercurial.
In some instances, for example, when you ssh into a machine, you may be presented with a message. It might look something like this:
| | _ __ ___ _ _ ___ ___ ___ | | ___ ___ _ ____ _____ _ __ | '_ ` _ \| | | | / __/ _ \ / _ \| | / __|/ _ \ '__\ \ / / _ \ '__| | | | | | | |_| | | (_| (_) | (_) | | \__ \ __/ | \ V / __/ | |_| |_| |_|\__, | \___\___/ \___/|_| |___/\___|_| \_/ \___|_| __/ | |___/ Welcome to my cool server. Any malicious and/or unauthorized activity is strictly forbidden. All activity may be logged.
This file prevents this from being shown.
Configures the ‘Readline environment’. This controls the way keys work when you’re entering a command into your shell. An example of how I find this useful is to make tab autocomplete regardless of filename case:
set completion-ignore-case on
This is my favorite of all the dotfiles. It is run once, manually, for the commands to run and take effect. Depending on what you’ve added to this file, you may need to restart your machine.
Some of the awesome things I love are:
⌘ + Qdoing so will also hide desktop icons
If you use screen, this removes the startup message.
I’m not that familiar with vim. However some of the things you can do with this file include enabling line numbers and adding syntax highlighting.
vim i have also included the powerline visual styling which will include a status line.
powerlinein my main installation script, so if you wish to have it, then please proceed with installing it separately with the fonts dependency.
--userparameter should be removed if you got an error while installation especially if you have python installed via Homebrew.
after installing powerline enable it by adding to the
This can be change depending on the path to the
If you use wget, this adds additional settings such as changing the timeout to 60 seconds rather than the default 15 minutes. It also sets the retry to three, rather than the default 20!
If you notice, some files that have mentioned above don’t exist in this repo. This is because i am using the amazing bash-it repo to organize those dotfiles. I recommend you head overthere and read how to use them.d
For installing the above files outside of the workflow mentioned in the main configurations, you need to run the following command
sh install.sh. The command will symlink all the files in this directory into your home directory, overwriting existing files.
When setting up a new Mac, you may want to set some sensible OS X defaults:
When setting up a new Mac, you may want to install some common Homebrew formulae (after installing Homebrew, of course).
brew bundle has been deprecated, thus i converted the files into executable shell ones:
brew install ~/.brewfile.sh
you can always remove or add files based on yor preferences. You can search for brew formulas here in order to add or get more information about the ones I am using.
My file contains the following
You could also install native apps with
brew install ~/.caskfile.sh
you can always remove or add files based on yor preferences. You can search for cask formulas here in order to add or get more information about the ones I am using.
cask file contains the following applications:
There are a bunch of useful Node.js command line tools that can be installed globally. For that, the file
.npm_globals.sh define an array of those applications. My global npm packages are:
.bash_profile+ shiny tilde repository