Files
fish-config/functions/__insert_previous_path_head.fish
T
rootiest ada58e8818 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
2026-04-30 01:03:13 -04:00

12 lines
371 B
Fish

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