基本的には、使用しているunicode
バージョンによって、絵文字を端末に出力することが出来ます。出力できる絵文字の種類はバージョンに左右されます。
$ echo -e "\xE2\x9C\xA8"
✨
絵文字のエイリアスを調べるには、以下のサイトが便利です。
ただし、絵文字のエイリアスは、そのままでは端末からは使えません。そんな時は、以下の様なプラグインを使います。
$ mkidr -p ~/.zsh/plugins
$ cd ~/.zsh/plugins
$ git clone https://github.com/robbyrussell/oh-my-zsh
$ cd oh-my-zsh/plugins/emoji
$ . ./emoji.plugin.zsh
$ echo $emoji[mouse_face]
🐭
また、端末から調べたいのであれば、emot
が便利です。
$ gem install emot
$ emot show
自身が管理するWebサイトで絵文字を使いたい場合は、http://git.emojione.comが便利ですが、基本的には、Ruby製のgemoji@githubを使います。
$ git clone https://github.com/github/gemoji
$ cd gemoji
$ bundle
$ rake emoji
$ cp scripts/console ./
$ ./console
>> Emoji.find_by_alias("cat").raw
=> "🐱" # Don't see a cat? That's U+1F431.
拡張はいくつかあり、gmac/gemoji-parserなどが便利です。