Dotfiles
Originally published
Last modified
User configuration files for unix-y utilities traditionally are named with a leading dot in order to hide them from regular directory listings. Hence: dotfiles.
See mine at https://gitlab.com/d10n/dotfiles. These pages break down and discuss why I have what I have.
Shell config: zshrc and bashrc
It's easy to get overwhelmed when reading other peoples' dotfiles. These pages focus on explaining individual parts of my bashrc and zshrc, with independent copy-pastable snippets. No more stressing about all that scary context!
- Improving the cd command
cd :/
cds to the root of the git repositorycd ./foo/bar/file.txt
cds to./foo/bar/
- making it easy to go to a file's containing directory when copy-pastingcd ....
cds to../../../
- each.
after the first 2 is expanded to../
- Making git more convenient to use
- Prevent accidental
git commit -a
if there are already staged changes - Truncate long lines in
git grep
output, so minified js files don't flood the terminal
- Prevent accidental
- A utilitarian Bash PS1 and Zsh PROMPT
- Why should you use a multi-line prompt?
- Automatically color the prompt based on the computer's hostname
- Zsh help command (like bash)
- Enable the zsh
help
command. Sometimes it's more convenient to use thanman zshall
- Enable the zsh
- Swap function: move A to B and B to A
- Enhanced which command
- Shows extra information about the commands in the output of
which
- Shows extra information about the commands in the output of
- Zsh: automatically show the duration of long-running commands
- Use zsh hooks to automatically print the start date, end date, and duration of commands that take longer than 5 seconds to complete
- Terminal text processing
Vim configuration: vimrc
See:
Patterns and best practices
The source .local
pattern
- Use .local files for machine-specific configuration
- This allows the same base configuration to be used on all computers while also allowing easy deviation from the base configuration on a per-machine basis
A successful philosophy for software configuration
General approach
Is it worth the time?
![https://xkcd.com/1205/](./is_it_worth_the_time.png)
I've arrived here after years of adjustments, fiddling, and tweaks, but I continue to refine my tool configuration as I encounter more ways to be productive.
It's worth the time to me.
- Each time you use automation, you save time. You only need to spend time automating something once.
- Reducing friction of reaching my goals when I am focused is critical.
- Spending time to make the process smooth later will help me keep my train of thought running when it matters most.
There are also some more indirect, but still significantly impactful payoffs:
- Time spent automating a task is also time invested in learning experience for creating more automation.
- Time spent on personal satisfaction is not time wasted.
- Working in an environment that gives me satisfaction makes me more productive.