Created
September 19, 2017 05:29
-
-
Save juergenhoetzel/83aa567601bbb8339366d265b5470364 to your computer and use it in GitHub Desktop.
Emojify bash completion: https://github.com/mrowa44/emojify
This file contains hidden or 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
# emojify completion -*- shell-script -*- | |
_emojify_complte(){ | |
local cur | |
_get_comp_words_by_ref -n : cur | |
COMPREPLY=( $(compgen -W "${_emojis[*]}" -- ${cur}) ) | |
__ltrim_colon_completions "$cur" | |
} | |
# sanity checks | |
if ! command -v _get_comp_words_by_ref >/dev/null; then | |
echo "Bash completion not installed" >&2 | |
elif ! command -v emojify >/dev/null; then | |
echo "Emoijify not installed" >&2 | |
else | |
# get list of emojis | |
mapfile -t _emojis < <(emojify --list|grep ^:|cut -d \ -f 1) | |
complete -F _emojify_complte emojify | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment