Adding inputrc post
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2022-11-13 09:48:03 -05:00
parent 8e4042a0ba
commit ce7c21985d
2 changed files with 35 additions and 1 deletions

View File

@@ -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 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 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 - If it's something I want only accessible on my home network then I put a block like
```plain
```txt
@local_network { @local_network {
path * path *
remote_ip <home subnet here> remote_ip <home subnet here>
} }
``` ```
in the directive. And voila. in the directive. And voila.
Then tell Caddy to reload the config and I'm done. Then tell Caddy to reload the config and I'm done.

32
content/posts/inputrc.md Normal file
View File

@@ -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
```