fish-shell/share/completions/j.fish
Johannes Altmanninger 29f35d6cdf completion: adopt commandline -x replacing deprecated -o
This gives us more accurate completions because completion scripts get
expanded paths
2024-01-27 09:28:06 +01:00

12 lines
431 B
Fish

function __history_completions --argument-names limit
if string match -q "" -- "$limit"
set limit 25
end
set -l tokens (commandline --current-process --expand-tokens)
history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | head -n$limit
end
# erase the stock autojump completions, which are no longer needed with this
complete -c j -e
complete -k -c j -a '(__history_completions 25)' -f