mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
Improve tab completions, show 3rd parties, real paths, etc.
* Create completions for installed, third-party plugins. Close #260. * Show real path in completion descriptions of local plugins. Close #261.
This commit is contained in:
parent
81dec12507
commit
a39ff774e8
1 changed files with 18 additions and 14 deletions
32
fisher.fish
32
fisher.fish
|
@ -303,19 +303,11 @@ function fisher
|
||||||
set -l IFS \t
|
set -l IFS \t
|
||||||
set -l real_home ~
|
set -l real_home ~
|
||||||
|
|
||||||
command find $config_glob -maxdepth 0 -type l ^ /dev/null | command awk -v real_home="$real_home" -v OFS=\t '
|
for name in (command find $config_glob -maxdepth 0 -type l ^ /dev/null)
|
||||||
|
set -l path (command readlink "$name")
|
||||||
|
set -l name (command basename "$name" | sed "s|$real_home|~|")
|
||||||
|
|
||||||
{
|
complete -xc fisher -n "__fish_seen_subcommand_from l ls list u up update r rm remove uninstall" -a "$name" -d "$path"
|
||||||
name = info = $0
|
|
||||||
|
|
||||||
sub(".*/", "", name)
|
|
||||||
sub(real_home, "~", info)
|
|
||||||
|
|
||||||
print(name, info)
|
|
||||||
}
|
|
||||||
|
|
||||||
' | while read -l name info
|
|
||||||
complete -xc fisher -n "__fish_seen_subcommand_from l ls list u up update r rm remove uninstall" -a "$name" -d "$info"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
command awk -v FS=\t -v OFS=\t '
|
command awk -v FS=\t -v OFS=\t '
|
||||||
|
@ -340,6 +332,16 @@ function fisher
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for i in (__fisher_plugin_get_url_info -- $config_glob)
|
||||||
|
switch "$i"
|
||||||
|
case fisherman\*
|
||||||
|
case \*
|
||||||
|
set -l name (__fisher_plugin_get_names "$i")[1]
|
||||||
|
|
||||||
|
complete -xc fisher -n "__fish_seen_subcommand_from l ls list u up update r rm remove uninstall" -a "$name" -d "$i"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -935,6 +937,7 @@ function __fisher_remote_index_update
|
||||||
}
|
}
|
||||||
|
|
||||||
' > '$index'
|
' > '$index'
|
||||||
|
|
||||||
" &
|
" &
|
||||||
|
|
||||||
__fisher_jobs_await (__fisher_jobs_get -l)
|
__fisher_jobs_await (__fisher_jobs_get -l)
|
||||||
|
@ -1739,13 +1742,14 @@ switch (command uname)
|
||||||
|
|
||||||
perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - '$elapsed')'
|
perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - '$elapsed')'
|
||||||
end
|
end
|
||||||
case '*'
|
|
||||||
|
case \*
|
||||||
function __fisher_get_epoch_in_ms -a elapsed
|
function __fisher_get_epoch_in_ms -a elapsed
|
||||||
if test -z "$elapsed"
|
if test -z "$elapsed"
|
||||||
set elapsed 0
|
set elapsed 0
|
||||||
end
|
end
|
||||||
|
|
||||||
math (command date +%s%3N) - $elapsed
|
math (command date "+%s%3N") - $elapsed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue