2010-04-27 34 views

回答

2

我不認爲裏面有完全相同的內容。您可以使用hl-line-mode來突出顯示當前行,並且定製該模式可讓您將突出顯示設置爲下劃線而不是默認的不同背景色 - - 但是下劃線你會在行內文本的末尾停下來,而不是繼續到窗口的邊緣。

18

在你的.emacs,定製臉上hl-line-mode,喜歡的東西:

(global-hl-line-mode 1) 
(set-face-attribute hl-line-face nil :underline t) 

hl-line-face是存儲facehl-line-mode的名稱的變量用來顯示當前行。您可以根據自己的喜好自定義:foreground:background和其他一些屬性。檢查文檔here

global-hl-line-mode打開,突出顯示所有緩衝區中的當前行。如果您只是想在一些緩衝區中使用,請使用M-x hl-line-mode將其打開。

12

有一個關於這個話題的好博客文章:M-x all-things-emacs

下面的代碼(輸入機智M-:或在〜/的.emacs)使用RGB代碼#222爲背景色(如果你在256-color mode!)並在當前行上加下劃線。取消設置前景色使用默認顏色,例如在突出顯示的行上保留C++顏色。

(global-hl-line-mode 1) 
(set-face-background 'highlight "#222") 
(set-face-foreground 'highlight nil) 
(set-face-underline-p 'highlight t) 

您可以檢查您是否需要更改highlight或(據我所知以上)hl-line用M-x和:

describe-face <RET> highlight 
describe-face <RET> hl-line 

此命令會顯示用於高亮顯示當前行的字體外觀的所有設置。你應該得到這樣的輸出:

Face: highlight (sample) (customize this face) 
Documentation: 
Basic face for highlighting. 

     Family: unspecified 
     Foundry: unspecified 
     Width: unspecified 
     Height: unspecified 
     Weight: unspecified 
     Slant: unspecified 
    Foreground: unspecified 
    Background: #222 
    Underline: t 
     Overline: unspecified 
Strike-through: unspecified 
      Box: unspecified 
     Inverse: unspecified 
     Stipple: unspecified 
      Font: unspecified 
     Fontset: unspecified 
     Inherit: unspecified