From 1a4589f8f73b2323b390ec71cc0e506a082630c7 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Fri, 27 Mar 2026 22:38:14 -0500 Subject: [PATCH] Add Use The Readline Keybindings Anywhere as a Unix TIL --- README.md | 3 ++- unix/use-the-readline-keybindings-anywhere.md | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 unix/use-the-readline-keybindings-anywhere.md diff --git a/README.md b/README.md index 9afed4c..9e67b39 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/). For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1767 TILs and counting..._ +_1768 TILs and counting..._ See some of the other learning resources I work on: @@ -1818,6 +1818,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Use fzf To Change Directories](unix/use-fzf-to-change-directories.md) - [Use Negative Lookbehind Matching With ripgrep](unix/use-negative-lookbehind-matching-with-ripgrep.md) - [Use Regex Pattern Matching With Grep](unix/use-regex-pattern-matching-with-grep.md) +- [Use The Readline Keybindings Anywhere](unix/use-the-readline-keybindings-anywhere.md) - [View A Web Page In The Terminal](unix/view-a-web-page-in-the-terminal.md) - [View The Source For A Brew Formula](unix/view-the-source-for-a-brew-formula.md) - [Watch The Difference](unix/watch-the-difference.md) diff --git a/unix/use-the-readline-keybindings-anywhere.md b/unix/use-the-readline-keybindings-anywhere.md new file mode 100644 index 0000000..9bfc7c9 --- /dev/null +++ b/unix/use-the-readline-keybindings-anywhere.md @@ -0,0 +1,27 @@ +# Use The Readline Keybindings Anywhere + +There are these features of the "shell" that I've often heard called _emac +keybindings_. These are things like `ctrl-a` (move the cursor to the beginning +of the line) and `ctrl-e` (move the cursor to the end of the line) that I use +every single day. There are several others that are in my heavy rotation, +however, I learned about a couple more reading through [Shell Tricks That +Actually Make Life Easier (And Save Your +Sanity)](https://blog.hofstede.it/shell-tricks-that-actually-make-life-easier-and-save-your-sanity/). + +These are [Readline +commands](https://www.gnu.org/software/bash/manual/html_node/Bindable-Readline-Commands.html) +(or keybindings) which means they are supported by anything that uses Readline +under the hood. So while you might be using these to great effect in `bash` and +`zsh`, you should look for other places they are available. + +A non-exhaustive list includes: + +- Ruby's `irb` +- `python` +- Node.js' `node` +- PostgreSQL's `psql` + +And many more similar REPLs and command line tools. + +Try these keybindings out in one of your favorites and when you're done hit +`ctrl-c` to exit out of it.