diff --git a/README.md b/README.md index 01cac52..9bde1a3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1491 TILs and counting..._ +_1492 TILs and counting..._ --- @@ -1516,6 +1516,7 @@ _1491 TILs and counting..._ - [Switch Versions of a Brew Formula](unix/switch-versions-of-a-brew-formula.md) - [Tell direnv To Load The Env File](unix/tell-direnv-to-load-the-env-file.md) - [Touch Access And Modify Times Individually](unix/touch-access-and-modify-times-individually.md) +- [Undo Changes Made To Current Terminal Prompt](unix/undo-changes-made-to-current-terminal-prompt.md) - [Undo Some Command Line Editing](unix/undo-some-command-line-editing.md) - [Unrestrict Where ripgrep Searches](unix/unrestrict-where-ripgrep-searches.md) - [Update Package Versions Known By asdf Plugin](unix/update-package-versions-known-by-asdf-plugin.md) diff --git a/unix/undo-changes-made-to-current-terminal-prompt.md b/unix/undo-changes-made-to-current-terminal-prompt.md new file mode 100644 index 0000000..92cb39c --- /dev/null +++ b/unix/undo-changes-made-to-current-terminal-prompt.md @@ -0,0 +1,19 @@ +# Undo Change Made to Current Terminal Prompt + +I frequently use a variety of ASCII command characters like `ctrl-u` to delete +the entire line or `ctrl-a` to jump to the front of a long line so I can make +some edits toward that side of the command or `ctrl-e` to jump to the end of +the command for the same reason. I sometimes even use `ctrl-k` to delete +everything after the cursor to the end of the line. + +What I didn't realize until now is that any of those actions plus regular +typing and hitting the backspace are all _undoable_. + +So, if I just wiped out half the line (with `ctrl-k`) and I immediately regret +it, I can restore it with `ctrl-_`. The system keeps of history of the actions +you've taken, so you can keep hitting `ctrl-_` to undo even further. + +The `ctrl-/` command does the same, per GNU's [Undo Changes in the Emacs +docs](https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Undo.html). + +[source](https://jvns.ca/ascii)