LoginSignup
9
9

More than 5 years have passed since last update.

バッファ内で正規表現にマッチする行を出力する: color-moccur.el

Last updated at Posted at 2012-07-30

バッファ内で正規表現にマッチする行を出力するにはoccurというのがデフォルトではいっているのですが、より操作性が優れているcolor-moccurをいれます。

インストールは下記を実行します。

M-x install-elisp-from-emacswiki color-moccur.el

設定ファイルに下記を追加します。

~/.emacs.d/init.el
;;; color-occur.el
(require 'color-moccur)
(setq moccur-split-word t) ;スペースで区切られた複数の単語にマッチさせる

M-x occur-by-moccurで起動します。検索したい単語を入力します。複数の単語の入力もできます。単語を入力したらマッチした行の一覧が表示されるので、npでマッチした箇所をいきいきできます。

また、isearch実行時にM-oを押すと、M-x occur-by-moccurに切り替えてくれます。

color-moccurの特徴として、Migemoをいれていればローマ字でも検索してくれるそうなのですが、残念ながら私の環境ではできませんでした。cmigemoだとだめなのかな。

9
9
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
9
9