LoginSignup
2
1

More than 5 years have passed since last update.

avyのヒント表示(スタイル)の違いについてのメモ

Last updated at Posted at 2015-09-04

画面内を素早くカーソル移動する方法のまとめで紹介したように、カーソルを素早く移動させるためのパッケージとしてavyが存在している。移動先の候補となる場所にヒント文字を表示するスタイルだが、この表示スタイルは実はいくつかの選択肢から選択可能であったので、メモを残しておく。

スタイル 説明
at ヒント文字を当該場所に1字ずつ表示。ace-jump-modeのスタイル。
at-full ヒント文字を当該場所にすべて表示 (デフォルト)
pre ヒント文字を当該場所ではなく、当該場所の前側に表示
post ヒント文字を当該場所ではなく、当該場所の後側に表示

これらは以下のように設定する:

(setq avy-style 'at)

それぞれのスタイルについて、スクリーンショットを用意したほうがわかりやすいが、何より使ってみたほうが早い。スタイルにはde-bruijnという選択肢も存在するが、自分がまだ良く把握してないので列挙することは避けた。
インタラクティブにスタイルを変更したいなら以下の関数を使ってみるのもありだろう。

(defun avy-select-style ()
  "Select `avy-style' interactively."
  (interactive)
  (let ((style (completing-read
                (format "Select style (current is '%s'): " avy-style)
                '("at" "at-full" "pre" "post" "de-bruijn") nil t)))
    (setq avy-style (intern-soft style))
    (message "avy-style is set to '%s'." avy-style)))
2
1
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
2
1