2019-03-31 11:00:21 +00:00
---
title: カレント行をハイライト表示
author: kazu634
date: 2008-12-08
wordtwit_post_info:
- 'O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:4429;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}'
categories:
- Emacs
---
< div class = "section" >
< p >
< a href = "http://www.emacsblog.org/2007/04/09/highlight-the-current-line/" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://www.emacsblog.org/2007/04/09/highlight-the-current-line/', 'Highlight the Current Line');" target = "_blank" > Highlight the Current Line< / a > にまとめられていました。私はこんな感じでグレーになるように設定してみました。
< / p >
< p >
< center >
< / center >
< / p >
< p >
< a href = "http://f.hatena.ne.jp/sirocco634/20081208230254" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://f.hatena.ne.jp/sirocco634/20081208230254', '');" class = "hatena-fotolife" target = "_blank" > < img src = "http://cdn-ak.f.st-hatena.com/images/fotolife/s/sirocco634/20081208/20081208230254.png" alt = "f:id:sirocco634:20081208230254p:image" title = "f:id:sirocco634:20081208230254p:image" class = "hatena-fotolife" / > < / a >
< / p > < / p >
< h4 >
highlight-current-line
< / h4 >
< p >
< a href = "http://www.emacswiki.org/cgi-bin/emacs/highlight-current-line.el" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://www.emacswiki.org/cgi-bin/emacs/highlight-current-line.el', 'highlight-current-line.el');" target = "_blank" > highlight-current-line.el< / a > をパスの通ったところにおいて、.emacsに次のように書きませう。
< / p >
< pre class = "syntax-highlight" >
< span class = "synSpecial" > (< / span > < span class = "synStatement" > require< / span > < span class = "synSpecial" > '< / span > < span class = "synIdentifier" > highlight-current-line< / span > < span class = "synSpecial" > )< / span >
< span class = "synSpecial" > (< / span > highlight-current-line-on < span class = "synStatement" > t< / span > < span class = "synSpecial" > )< / span >
< span class = "synComment" > ;; To customize the background color< / span >
< span class = "synSpecial" > (< / span > set-face-background < span class = "synSpecial" > '< / span > < span class = "synIdentifier" > highlight-current-line-face< / span > < span class = "synConstant" > " light yellow" < / span > < span class = "synSpecial" > )< / span >
< / pre >
< h4 >
HL-LINE
< / h4 >
< p >
GNU Emacs21はビルトイン関数が用意されていたよ。グローバルにその関数をオンにするには次のようにするよ。
< / p >
< pre class = "syntax-highlight" >
< span class = "synSpecial" > (< / span > global-hl-line-mode < span class = "synConstant" > 1< / span > < span class = "synSpecial" > )< / span >
< span class = "synComment" > ;; To customize the background color< / span >
< span class = "synSpecial" > (< / span > set-face-background < span class = "synSpecial" > '< / span > < span class = "synIdentifier" > hl-line< / span > < span class = "synConstant" > " #330" < / span > < span class = "synSpecial" > )< / span > < span class = "synComment" > ;; Emacs 22 Only< / span >
< span class = "synComment" > ;(set-face-background 'highlight " #330" ) ;; Emacs 21 Only< / span >
< / pre >
< p >
(Emacs21とEmacs22の時の違いに注意してね)
< / p >
< p >
< / p >
< h4 >
HIGHLINE
< / h4 >
< p >
< a href = "http://www.emacswiki.org/cgi-bin/emacs/highline.el" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://www.emacswiki.org/cgi-bin/emacs/highline.el', 'highline.el');" target = "_blank" > highline.el< / a > はhl-line, highlight-current-line, そしてlinemenuから発想を得て作られたよ。XEmacs向けならこれが一番いい選択肢だよ。使うときは次のようにしてね。
< / p >
< pre class = "syntax-highlight" >
< span class = "synSpecial" > (< / span > < span class = "synStatement" > require< / span > < span class = "synSpecial" > '< / span > < span class = "synIdentifier" > highline< / span > < span class = "synSpecial" > )< / span >
< span class = "synSpecial" > (< / span > highline-mode < span class = "synConstant" > 1< / span > < span class = "synSpecial" > )< / span >
< span class = "synComment" > ;; To customize the background color< / span >
< span class = "synSpecial" > (< / span > set-face-background < span class = "synSpecial" > '< / span > < span class = "synIdentifier" > highline-face< / span > < span class = "synConstant" > " #222" < / span > < span class = "synSpecial" > )< / span >
< / pre >
< h4 >
他にもたくさんあるよ
< / h4 >
< ul >
< li >
< a href = "http://www.emacswiki.org/cgi-bin/emacs/hl-line+.el" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://www.emacswiki.org/cgi-bin/emacs/hl-line+.el', 'hl-line+.el');" target = "_blank" > hl-line+.el< / a >
< / li >
< li >
< a href = "http://www.emacswiki.org/cgi-bin/emacs/col-highlight.el" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://www.emacswiki.org/cgi-bin/emacs/col-highlight.el', 'col-highlight.el');" target = "_blank" > col-highlight.el< / a >
< / li >
< li >
< a href = "http://www.emacswiki.org/cgi-bin/wiki/CrosshairHighlighting" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://www.emacswiki.org/cgi-bin/wiki/CrosshairHighlighting', 'Crosshair Highlighting');" target = "_blank" > Crosshair Highlighting< / a >
< / li >
< / ul >
< blockquote >
< ul >
< li >
「emacs」に関連する最近のエントリ < ul >
< li >
< a href = "http://d.hatena.ne.jp/sirocco634/20081207/1228655543" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://d.hatena.ne.jp/sirocco634/20081207/1228655543', ' 『やさしいEmacs‐ Lisp講座』を購入 – 武蔵の日記');" target = "_blank" > 『やさしいEmacs‐ Lisp講座』を購入 – 武蔵の日記< / a >
< / li >
< li >
< a href = "http://d.hatena.ne.jp/sirocco634/20081124/1227538608" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://d.hatena.ne.jp/sirocco634/20081124/1227538608', ' outputz試してみました。 – 武蔵の日記');" target = "_blank" > outputz試してみました。 – 武蔵の日記< / a >
< / li >
< li >
< a href = "http://d.hatena.ne.jp/sirocco634/20080927/1222526533" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://d.hatena.ne.jp/sirocco634/20080927/1222526533', ' anything.el関係やperl-completion.elの導入してた – 武蔵の日記');" target = "_blank" > anything.el関係やperl-completion.elの導入してた – 武蔵の日記< / a >
< / li >
< li >
< a href = "http://d.hatena.ne.jp/sirocco634/20080825/1219673282" onclick = "__gaTracker('send', 'event', 'outbound-article', 'http://d.hatena.ne.jp/sirocco634/20080825/1219673282', ' Flymakeが便利 – 武蔵の日記');" target = "_blank" > Flymakeが便利 – 武蔵の日記< / a >
< / li >
< / ul >
< / li >
< / ul >
< / blockquote >
2019-04-02 16:06:15 +00:00
< / div >