Will Murphy's personal home page

Will's Picks

These are things that I recommend or like in some way. They' too short or underdeveloped for a whole blog post, but I hope you'll check them out.

Astronvim

I recently started using astroNvim as my primary editor config.

There are a few really great things about it:

  1. The configuration is beautiful out of the box
  2. It has a very active and responsive community
  3. It has a rich community plugin list
  4. It takes a template approach (more below)
  5. The template is super modular and intuitive; I have a really easy time modifying it.

The “template approach” here goes like this: They maintain a template repo that contains all the lua for a standard, default setup of astroNvim. If you want a default installation you can just clone it into ~/.config/nvim and it will work immediately. When you want to start modifying the config, just fork the template, add your fork as the remote in ~/.config/nvim, and make your changes.

There are some really thoughtful things that they’ve done in the template, as well. For example, there are example files that are guarded by if true then return {} end and you can remove that line to quickly change behavior. There are examples of how to add community plugins. There’s a file called polish.lua that is called last, if you want to make sure you can tweak little settings and not have some plugin change them back depending on the order plugins are loaded in.

It’s my new favorite tool to write code in. You can check out my config, but notice how few commits I have after the template, and I’m productive in it in Go and Python.

Yay for astroNvim!

Rustlings: my favorite tiny-broken-program teaching tool

There are lots of tools that are shaped like, “learn language X by fixing tiny broken programs that are written in X.” Rustlings is my favorite. (Some other examples are Ruby Koans, Lua Missions, Ziglings.)

Here are some things that are great about Rustlings:

  1. It has a cool little watcher program that runs the next test and shows a progress bar. (I am highly motivated by made-up internet points, so having a progress bar was highly motivating.)
  2. The little watcher program handles re-running tests, which saved me typing typing “up arrow, up arrow, enter” to see if my solution was right 1 million times.
  3. There little watcher program has “hint” and “reset” buttons.
  4. It’s not really Rustlings fault specifically, but the careful attention to error messages in the Rust ecosystem made the whole process fun.

So my pick today is: Go try Rustlings! If come for the Rust, stay for the cute little TUI that guides you through.

git alias for diff similar to what GitHub shows

Use this to show what was added by a branch

This command shows what’s added to a project by the current branch, ignoring changes to origin/main since the current branch diverged. I think this is basically what is shown on PRs in GitHub:

git diff $(git merge-base origin/main HEAD)..HEAD

I find this a bit much to type, so I’ve added the git alias bdiff (for “branch diff”) like so:

git config --global alias.bdiff '!f() { git diff $(git merge-base HEAD origin/main) HEAD "$@"; }; f'