💾 Ian's Dotfiles and Vim config
These are my dotfiles. There are many like them, but these are mine.
This started around 2001 or so when I used lots of different machines and environments. Now I mostly use macOS and Linux but still keep the environment in sync.
curl -sL https://statico.link/zsh | zsh
chshor otherwise set your shell to use Zsh
- Restart your shell
Optionally create a
.postinstall with some machine-specific commands, like
git config --global user.email "email@example.com"". You can also create a
.gvimlocal for machine-specific Vim customizations.
- Fork this repo
install.zshto point at your own
- Go nuts
Highlights (or, Why I Use This)
My first boss told me that I should have a digital toolkit -- a set of tools that I keep with me that I can use anywhere. In college I used many different kinds of Unix variants, and so it made sense to build a kit that could bootstrap my environment anywhere. Today, I use macOS, Windows, and various distributions of Linux, and this kit has proven invaluable in getting set up quickly on new hardware and VMs.
While this project includes a huge collection of configuration snippets I've collected over the years, a few parts stand out and are things I use daily:
zshrc, which has a minimal, customized prompt that I like the best, as well as many aliases and shortcuts to standardize environments (like making sure Unicode displays properly and
lsshows colors) and reduce keystrokes (like with my ~60 or so Git aliases). There are also a few functions that make host-specific customizations easy using a
.zshlocalscript which never gets checked in. There are tons of tricks in there so it's worth a skim.
vimrc, which many people became interested in after reading my articles about Vim. I also have an
update.shscript which installs all of the Vim plugins and themes I like to use, and it gets run as part of the Zsh update process (aliased to
ZU). Is my Vim update thing better than Vundle or another plugin manager? Maybe. It's very simple and fast and works everywhere, so I stick with it.
Why Zsh instead of Bash?
Only a few reasons, honestly:
Easier completion - I can type
/u/l/b/xTab and that completes to
I'm able to hack Ctrl-W to delete to the previous word or slash, so
I've got a thing that shows me five red dots when a completion is in progress, such as when completing files from remote SSH servers.
Globbing - The
**recursive operator and qualifiers like
(/)for globbing are essential, like
Legacy - I started using Zsh in 2002 or so when it was edgy.
Here's what I use the most often on the command line:
cdto the most commonly used directory that fuzzy-matches foo (via autojump)
llfor long directory listings,
ltrfor showing the most recent files
- Other single-character aliases:
- Meta-L which appends
2>&1|lessto the command and hits Enter, running the command and viewing its output in a pager
ZUto update Vim plugins or just
ZRto restart Zsh after a .zshrc change
- Searching with
rg(ripgrep), then Ctrl-AvEnter (changing
vrg) to edit all of the files that matched in Vim
cding to a directory and then using Meta-P to pop to the previous directory (since
auto_pushdis enabled and silent)
pslto search for processes (since I never remember the
pgrepsyntax and it's never been consistent across platforms)
trashcommands that work across macOS and Linux
- If I'm typing a command but realize that I need to do something else first, Meta-Q queues the current command and clears the command line, then pastes it back in after I enter and run another command first.
- Git commands:
gdfor a git diff,
glfor a quick log,
sci <message>to commit everything with a message, or
gapto cherry pick and then
gc <message>to commit.
- Fuzzy history search using Ctrl-R and FZF
- Each host gets a different
colorpromptcommand in its
~/.zshlocal. I use
256-colors.shto pick a color. (Both are already in the
~/bin/directory, which is added to the
Testing is easy with Docker:
$ docker build . --tag dotfiles $ docker run --rm -it dotfiles root@987552d4c629:/ 〉