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:
@@ -0,0 +1,11 @@
|
||||
function __insert_previous_path_head
|
||||
# Get the last command tokens
|
||||
set -l tokens (string split -n " " -- $history[1])
|
||||
|
||||
# If there are tokens, take the last one and strip the 'tail'
|
||||
if set -q tokens[-1]
|
||||
set -l path_head (dirname -- $tokens[-1])
|
||||
# Insert it into the current command line
|
||||
commandline -i -- $path_head
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user