feat(shell): add bash-style history expansions and interactive keybindings

- Replicate bash bang-operations (!^, !*, !string, etc.) via abbreviations
- Add Ctrl+G for previous path head insertion
- Add Ctrl+F for interactive history substitution
- Add Ctrl+Alt+U to quickly replace command tokens
- Update README documentation for all new features
This commit is contained in:
2026-04-30 01:03:13 -04:00
parent 6722deea3c
commit ada58e8818
12 changed files with 234 additions and 2 deletions
+12
View File
@@ -136,6 +136,18 @@ Full tab completion for the `tailscale` CLI is provided via `conf.d/tailscale.fi
---
## Key Bindings
Beyond standard shell and FZF bindings, these custom interactive shortcuts are available:
| Binding | Action | Description |
|---|---|---|
| `Ctrl+G` | Previous Path Head | Behaves like `!$:h` in Bash. Inserts the directory part of the previous command's last argument. |
| `Ctrl+F` | Interactive History Sub | Behaves like `!!:s/old/new/` in Bash. Performs substitution on the previous command using `old/new` syntax. |
| `Ctrl+Alt+U` | Replace Command Token | Strips the first token (the command) from the current line. **If the line is empty**, it pulls the previous command and strips its first token, placing the cursor at the start for a quick replacement (e.g., changing `mkdir` to `cd` while keeping the paths). |
---
## Functions
### Modern CLI Replacements