mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
33a9659cd1
Missed in 368017905
(builtin commandline: -x for expanded tokens, supplanting
-o, 2024-01-06).
12 lines
433 B
Fish
12 lines
433 B
Fish
function __history_completions --argument-names limit
|
|
if string match -q "" -- "$limit"
|
|
set limit 25
|
|
end
|
|
|
|
set -l tokens (commandline --current-process --tokens-expanded)
|
|
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
|