Tweaking the tool chain /2016-01
Once you’ve been using *nix for a while it’s easy to become complacent with the dozen or so tools you reach for most often. As part of starting a new job, and having a Mac ‘bestowed’ on me, I’ve decided to make a conscious effort to choose my tools, rather than reach for the familiar.
The first batch that have managed to survive January and still be mostly helpful are:
alias '..'='cd ..'
We’ll start with the simplest, a basic alias. Adding this line to your
.aliases or some such) saves you a massive 3
characters every time you want to go back up a directory; and of course
requires your muscle memory to be retrained. However, and this is a -very-
subjective thing, it just feels nicer to me. I didn’t think it’d have
much impact but it really has.
Now we’ll move to replacing the venerable
grep with ag - The Silver
Searcher. I’m currently
using it to replace interactive command line
grep, and I’ve aliased
ag to ease in to it. Ag is both astoundingly fast and aware
of version control ignore files and doesn’t search the files they
indicate, which can be a massive speedup. This is a transparent change
to my work flow but it’s sped up day to day tasks. It’s also packaged in
a number of desktop friendly distros.
Next up is a new command to my tooling - NCurses Disk Usage - ncdu this is a lovely, very focused, tool that shows you where your disk space is being consumed and easily allows you to explore your file system. It’s more a desktop than a server tool but it’s a perfect fit for its problem domain.
Finishing up we have the biggest change to how I’m working at the moment,
fzf - A command-line fuzzy finder.
It’s hard to convey just have much of an impact using this tool has on
your normal shell commands without trying it. In essence it tries to
remove the need for you to type more than enough characters to identify
your target. An example would be to edit
multi/auto/NetAddr/IP/UtilPP/bin2bcd.al. Once your vim and bash
config are in place you’d type
vim**<TAB> and then you’d only need to
NetIP2bcd to have the possible file list narrowed down to a
handful of options. I’m aware I’m doing the command a disservice
with a textual explanation, it’s well worth having a play with.
Lastly I’ve deleted my old
.vimrc. It was built up over the years to
do tasks I’ve not needed for years, work around OS issues and defaults
and is no longer an easily understandable, consistent file. So I’ve
decided to spend a month with bare vim and then add things in as I miss
them or grow frustrated.
When I started using Unix, on AIX/HPUX and SUNOS, building the tools, customising your environment and trying to keep them deployed in a consistent way was a significant challenge. With modern tooling you can easily customise your environment to suit your work flow and this year I’m going to attempt to do just that. No more working to the lowest common denominator.