From ce7c21985d054051646dc7522775c63fa1cc566b Mon Sep 17 00:00:00 2001 From: James Brechtel Date: Sun, 13 Nov 2022 09:48:03 -0500 Subject: [PATCH] Adding inputrc post --- content/posts/home-webserver.md | 4 +++- content/posts/inputrc.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 content/posts/inputrc.md diff --git a/content/posts/home-webserver.md b/content/posts/home-webserver.md index 3cbf761..a485059 100644 --- a/content/posts/home-webserver.md +++ b/content/posts/home-webserver.md @@ -30,12 +30,14 @@ I have a super straight forward setup, generally: - If it's a service then I add it with a `reverse_proxy` block - If it's a static site (like this) then there's a block for - If it's something I want only accessible on my home network then I put a block like -```plain + +```txt @local_network { path * remote_ip } ``` + in the directive. And voila. Then tell Caddy to reload the config and I'm done. diff --git a/content/posts/inputrc.md b/content/posts/inputrc.md new file mode 100644 index 0000000..b33be7a --- /dev/null +++ b/content/posts/inputrc.md @@ -0,0 +1,32 @@ ++++ +title = "vi-mode editing in most places" +date = "2022-11-13" ++++ + +# Vi/Vim bindings + +For my sake, I prefer to have Vim bindings in as many places as possible. + +Most shells can be configured to use Vim bindings by putting `set -o vi` somewhere in your shell startup script. + +If you're using ZSH then you'll probably want an additional binding to restore CTRL-R reverse history search. + +`bindkey '^R' history-incremental-search-backward` + +For CLI tools that use the `readline` library then you can configure its input mode using a `.inputrc` file in your `$HOME` directory. + +This affects REPLs like `ghci` and tools like `psql`. + +```txt +set editing-mode vi +$if mode=vi + +set keymap vi-command +# these are for vi-command mode +Control-l: clear-screen + +set keymap vi-insert +# these are for vi-insert mode +Control-l: clear-screen +$endif +```