When I was first starting out in software engineering, it felt like there was a never-ending barrage of tooling to learn. After more than a decade in CLI environments, I still find myself constantly learning new features and fun facts - but it’s fairly rare that I learn something new that I end up using day-to-day.
I wanted to share some things I learned at relatively late stages in the game that ended up being significant productivity boosters for me - perhaps some of them are well-known, but in the spirit of this XCKD, I hope that someone reading this might pick up something new.
Alt-delete
deletes the whole word before cursorAlt-d
deletes the whole word after cursorCtrl-k
deletes (kill) everything after the cursorWhatever is deleted is stored in the “killring” and can be pasted(yanked) back with
Ctrl-y
(like someone else already mentioned), consecutive uses ofAlt-delete
/Alt-d
add to the killring.Alt-b
/Alt-f
moves one word backwards / forwardsAlt-t
swaps (translocates) the current word with the previous oneCtrl-_
undo last edit operationAll those bindings are the same as in emacs.
Also, normally
Ctrl-d
inserts the end-of-file character, and typically can be used to close an active shell session or when you have some other interpreter open in the terminal for interactive input.