LoginSignup
4
4

More than 5 years have passed since last update.

Webや端末から絵文字を使う方法

Last updated at Posted at 2016-01-30

基本的には、使用している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などが便利です。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4