mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
enabled gi autocomplete and parameters separated by spaces
This commit is contained in:
parent
9c3d1506ff
commit
ab3671906f
@ -2,5 +2,19 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
function gi
|
function gi
|
||||||
curl http://gitignore.io/api/$argv
|
#curl http://gitignore.io/api/$argv
|
||||||
|
set -l params (echo $argv|tr ' ' ',')
|
||||||
|
curl http://gitignore.io/api/$params
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# enable the complation by invoking `gi list`
|
||||||
|
if not set -q -g gi_list
|
||||||
|
timeout 2 ping -c 1 -q gitignore.io >/dev/null
|
||||||
|
set gi_available $status
|
||||||
|
|
||||||
|
if test $gi_available
|
||||||
|
set -g gi_list (gi list| tr ',' ' ' ^/dev/null)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
complete -c gi -a "$gi_list"
|
Loading…
Reference in New Issue
Block a user