3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

highlight-symbolをsmartrepを使ってキー消費を抑えながらバインドする

Last updated at Posted at 2013-11-23

Vimの'*'に相当するやつ。色々試行錯誤の結果としてやっといい感じになってきた。後はsmartrepが起動キーと一緒に特定のコマンドを実行出来るようになればなぁ。M-sの一回目からhighlight-symbol-nextに割り当てたい。

  • M-s連打で次のシンボルに移動
  • M-s h でハイライトのON/OFF
  • M-s n N …でシンボルの前後に移動
  • M-s j kで関数内スコープでシンボルを前後に移動
  • M-s r でシンボルを置換
(require 'highlight-symbol)

(global-unset-key (kbd "M-s"))

(smartrep-define-key global-map "M-s"
  '(("M-s"        . 'highlight-symbol-next)
    ("h"          . 'highlight-symbol-at-point)
    ("n"          . 'highlight-symbol-next)
    ("p"          . 'highlight-symbol-prev)
    ("N"          . 'highlight-symbol-prev)
    ("l"          . 'highlight-symbol-list-all)
    ("a"          . 'highlight-symbol-remove-all)
    ("o"          . 'highlight-symbol-occur)
    ("j"          . 'highlight-symbol-next-in-defun)
    ("k"          . 'highlight-symbol-prev-in-defun)
    ("r"          . 'highlight-symbol-query-replace)))
3
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
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?