A couple of weeks ago I saw this nice post on advanced Bash shortcuts over at ${me:-whatever}, If you haven’t seen it, be sure to take a look. Even though I’ve been using Bash for more years than I care to contemplate, I still learned a couple of things I didn’t know—or at least a couple of things that I may have known but had forgotten.
I was reminded of that post when I read Mickey’s latest Mastering Emacs offering, Shell & Comint Secrets: History commands. It turns out that many (most) of those Bash shortcuts are available in any comint process. That includes the shell command, of course, but it’s also true of things like the Python shell.
Mickey shows a number of ways to use these shortcuts to ease your workflow. Some of them are probably too much trouble to bother with but some are really useful. For example, you can capture the \(n^\text{th}\) argument of the last command and reinsert it in the current command. If you’ve ever had to use a/really/long/path/with/ReallyLongNames
in several commands in a row, you can see how this could be a real time saver.
Head on over to Mickey’s post to get the details and see some of the other shortcuts and how you can leverage them. Everything Mickey posts is a must read for Emacsers and this post is no exception.