I've always been quite the fan of keyboard shortcuts, after all why move your hand to the mouse to dick around clicking things if you can just do the same thing without moving your fingers from the home row. In my eyes the arrow keys might as well be on the other side of the room. Did you know your shell has a bunch of shortcuts to make your life a little easier? A library called readline[1] is responsible and I think all of these work on Mac too but your milage may vary.
- Move back through your history with
ctrl-p - Move forward through your history with
ctrl-n - Need to incrementally search through your history?
ctrl-rhas got you, you can keep pressingctrl-rto see it's suggestions. Slight sidebar, if you havefzf[2] installed it extends this functionality showing you what it has found. - Are there a bunch of commands that you ran in a sequence before that you want to run again? Before I used to keep pressing
upupupuntil I found what I needed, pressed enter, then repeated this horribly inefficient cycle. Try this, search for the first one withctr-rthen pressctrl-oto run it, the next command in your history will be preloaded onto the command line for you. You can keep pressingctrl-oto run each command and load the next. ctrl-eto jump to the end of the command linectrl-ato jump to the start of the command linectrl-bto go back one characterctrl-fto go forward one characteralt-fto go forward one wordalt-bto go back one word.ctrl-uto delete everything from your cursor to the start of the line.ctrl-wto delete one wordctrl-hto delete one letter
There are a LOT more short cuts, especially if you have meta key support enabled in your terminal (for example meta-u will upcase the word you're on).
Hope people find those useful.