hohei’s diary

備忘録?

emacsの行番号の色を mozc入力モードで切替え

入力モードによってモードラインの色を切替えるものばかりが目につくのですが、設定が複雑なわりに視認性の向上に貢献してない気がします ω

以下の設定をinit.elなどに加えてください.

hlinum.el をつかってます.

https://github.com/tom-tan/hlinum-mode/blob/master/hlinum.el

(require 'hlinum)
(custom-set-variables '(global-linum-mode t))
;; 色の変更
(custom-set-faces
 '(linum-highlight-face ((t (:foreground "black"
                             :background "green2")))))
(hlinum-activate)


;; カーソルの色と形を入力モードにより変える
(add-hook 'input-method-activate-hook
          (lambda() (setq default-cursor-type 'hollow)
                    (custom-set-faces; hlinum の色変更
                     '(linum-highlight-face ((t (:foreground "black"
                                                 :background "magenta1")))))))

(add-hook 'input-method-inactivate-hook
          (lambda() (setq default-cursor-type 'box)
                    (custom-set-faces; hlinum の色変更
                     '(linum-highlight-face ((t (:foreground "black"
                                                 :background "green2")))))))