2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-01-30 05:43:33 +00:00
fish-shell/share/completions/j.fish

13 lines
407 B
Fish
Raw Normal View History

function __history_completions --argument limit
if echo $limit | string match -q ""
set limit 25
end
set -l tokens (commandline --current-process --tokenize)
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