mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-27 03:13:37 +08:00
13 lines
420 B
Fish
13 lines
420 B
Fish
function __history_completions --argument limit
|
|
if string match -q "" -- "$limit"
|
|
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
|