Created
August 12, 2023 06:54
-
-
Save BaksiLi/3745465079978f76ade84d8cdc4780e1 to your computer and use it in GitHub Desktop.
Zinit Install GitHub completion or Gist snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local GH_RAW_URL='https://raw.githubusercontent.com' | |
install_completion(){ zinit for as'completion' nocompile id-as"$1" is-snippet "$GH_RAW_URL/$2"; } | |
local GHG_RAW_URL='https://gist.githubusercontent.com' | |
install_gist_snippet() { | |
local url="$2" | |
if [[ $url != $GHG_RAW_URL* ]]; then | |
url="$GHG_RAW_URL/$url" | |
fi | |
if [[ $url != *raw ]]; then | |
url="${url://\//}/raw" | |
fi | |
zinit ice wait lucid id-as"$1"; zinit snippet "$url" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example: