Sharing my shell dotfiles for developers using macOS, Linux, ZSH or Bash
My aim is make my configs easy to understand and manage - using functions to make the shell config lighter, if statements to turn on features when needed. I use aliases at the shell and git level to make it easy to reach for long or frequently-used commands.
If want to just see config files, skip ahead to Part 2.
Click links to skip to that part of the series.
- What is a dotfile?
- My shell config setup
- My shell aliases
- My git config file (mostly git aliases)
- My global git ignore file
- How to write a shared config that gets loaded by both
Let me give you an idea of what development I do on a daily basis. You'll see the configs fit into these areas.
- Linux and macOS
- Bash and ZSH
- Git for version control
- A bit of scripting using Deno, Go and Ruby
A dotfile is a file or directory which has a name that starts with a "full-stop" or "dot".
On "Unix-like systems", such as Linux and macOS, a dotfile is hidden by default when viewing files in a folder browser and the shell. This makes it harder to see and edit but keeps them out of the way unless you are actually looking for them.
For example running
Downloads etc. but
ls -a will show all hidden files like
.bashrc and directories like
Config files are typically stored are dotfiles in the user home directory. Such as
You can open it for editing from the command-line using something like this:
$ edit ~/.bashrc $ nano ~/.bashrc $ vim ~/.bashrc $ code ~/.bashrc # VS Code $ subl ~/.bashrc # Sublime
The next few posts in this series cover content for files in user directory.
I provide links to files in my MichaelCurrin/dotfiles repo, which I created specifically for sharing in this blog post.
I also highlight and explain some of the content directly in the posts.
For further reading, see this dotfiles post by
@helderburato. It includes dotfiles by a few people.
I have heard of
yadm as a dotfile manager from comments on my post. I haven't used it before but its site has a couple of dotfile repos linked there.
Side note - the way I manage my dotfiles is actually through a private repo cloned locally. I have symlink in my home directory pointing to
.bashrc and others in the repo, so get the benefit of my repo code being used live and I get to regularly push and pull changes on GH to keep work and personal laptops in sync. I find it works well.
Onto the configs! Go to Part 2 for my shell configs.