21
15

More than 5 years have passed since last update.

Zshには組み込みでテトリスがインストールされている

Last updated at Posted at 2013-10-01

tetris

% autoload -Uz tetris

を実行して M-x tetris(Macだと esc+x 後にtetrisと入力する。上のgifではこの方法を用いている)とするか、上記に加えて

% zle -N tetris
% bindkey '...' tetris

を実行してから ... と入力するとターミナルでテトリスを遊べます。

参考

一言で言えば autoload$fpath のディレクトリに置いてあるzshスクリプトを関数として実行できるようにするものです。デフォルトで $fpath に指定されているディレクトリには800を超える関数が登録されていて(大半は補完機能のためのものですが)、その中の1つに tetris があります

% echo $fpath
/usr/share/zsh/5.0.2/share/zsh/functions
% head -n 7 /usr/share/zsh/5.0.2/share/zsh/functions/tetris
# Someone once accused zsh of not being as complete as Emacs, because it
# lacks Tetris and an adventure game.
#
# autoload -Uz tetris
# zle -N tetris
# bindkey '...' tetris

意訳

zshにはEmacsみたいにテトリスとかアドベンチャーゲームがないからクソだって言っているやつがいたからカッとなって作った

21
15
1

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
21
15