fish-shell/share/completions/j.fish

13 lines
431 B
Fish
Raw Normal View History

function __history_completions --argument-names limit
2020-01-22 09:54:52 +00:00
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