∞
Writing JS in Vim
This post was originally published on Medium. You can view that here.
These days, the experience of writing JavaScript is influenced as much by the tools used during development as those used at runtime. Projects exist that can drastically improve your code quality, from basic help like spotting typos to adding full-blown type checking to a dynamically typed language. As great as these tools are on their own, they’re made even more useful when they can be brought directly into your editor.
∞
Finding an Old Commit
If you end up in a situation where you want to grab an old commit (from some other branch, even) but don’t know the commit hash, you want to access the reflog. It allows you to access old commits easily:
git reflog | head -200 | grep TMP Will show info on all the commits within the last 200 that has a message containing TMP. This is really useful if you’re using some temporary hack that you want to apply/remove repeatedly without keeping it in a branch.
∞
Fixing $PATH changes in tmux
I noticed that my $PATH was being set differently between tmux and a regular shell. Specifically, without tmux my Ruby installation from asdf would override the default one but in tmux it would not.
Eventually, I was tipped off by this blog post that the issue might be my /etc/zprofile file, and that was indeed the case; changing the code to this fixed it for me:
if [ -x /usr/libexec/path_helper ]; then PATH="" eval `/usr/libexec/path_helper -s` fi Now, the directories that I want on the front of $PATH are consistently placed there.