Learning as I Watch Others Navigate Their Toolbox
Earlier this week, Dwight joined the Forem team. we paired on scoping a problem.
While Dwight drove, I helped navigate. As he was typing in his terminal, I noticed an interesting feature. With a blank input prompt a drop-down appearred and he’d select a command from history.
By default, when I typed Ctrl+r I got history-incremental-search-backward
. Which was a rather simple prompt for clumsily searching past commands. What I saw in Dwight’s terminal was something far more robust. When he typed Ctrl+r, he got a list of past commands and could type to filter towards those commands.
I asked about the configuration, and Dwight told me it was a plugin.
New to Me Tools
After our pairing session, I went looking.
First, I stumbled into hstr, a command to easily view, navigate and search command history with shell history suggest box for bash and zsh.
I installed it and configured that plugin.
This set me on the path for further exploration. I then found fzf, a general-purpose command-line fuzzy finder.
I started exploring that, and the extensive community wiki entries that leverage fzf
.
I added to my terminal functions:
- fkill, a fuzzy search of processes to kill.
- fe, a fuzzy file finder that opens the selected file(s) in my editor.
- rfv, a two stage file name and content finder.
I also replaced the recently installed hstr
with fzf
’s fzf-history-widget
And while reading through the wiki, I found forgit, a Utility tool for using git interactively. Powered by junegunn/fzf.
I favor Emacs 🔍’s amazing magit package for most git interactions. But forgit
’s interactive log viewer provides functionality that I haven’t found in Magit 🔍.
Wrapping Up
If you often interact with git
via the command-line, I encourage you to look into forgit
. It provides userful interactive additions to your git
repertoire.
These three tools—hstr
, fzf
, and forgit
—are all fantastic command-line additions. While I tend to spend more of my time in Emacs than on the command-line, I do find myself in the command-line doing some tasks. These commands, in particular fogit::log
(and it’s alias glo
) are useful tools for my toolkit.
I also spent some time reading through the archaic output of my bindkey
output. I learned that Ctrl+x then Ctrl+e would open a new buffer for my configured editor with the current command line’s prompt’s content as the buffer’s content.
All of this learning and exploring came about because I paired with a developer and was curious about how they navigated their toolbox.
Top comments (2)
That's cool to hear others are pairing too! I was really turned off by it at first but it got me up to speed so fast and I was actually talking to others programmers. It's so much easier to learn for another person that to go through long tutorial's in my opinion.
I've been programming professionally for more than two decades, and I often learn a new thing or two from everyone I pair with. I find the "navigating role" to be very fulfilling and a reminder that I need to explain lots of the "leaps in logic" I make in my head.