emacs 設置emacs的外觀

設置emacs的外觀

emacs的外觀包括文本區的外觀,輔助區的外觀,狀態行的外觀,光標的外觀等,html

每一個外觀都有名字,而且都有下面屬性:node

  • Font Family: 字體名字
  • Font Foundry: ?
  • Width: 字體寬度
  • Height: 字體寬度
  • Weight: 字體重
  • Slant: 斜體
  • Underline: 下劃線
  • Overline: 上劃線
  • Strike-through: 透過線
  • Box around text: ?
  • Inverse-video: ?
  • Foreground: 前景色
  • Background: 背景色
  • Stipple: ?
  • Inherit: 繼承別的外觀

如何設置外觀呢?emacs經過【Face】的東西來設置

face的定義:face能夠定義字體,顏色等。大多數主編輯模式(major mode)分配各類face給函數名,註釋,變量,關鍵字等,經過【Font Lock mode】。【Font Lock mode】的說明在後面。

Emacs can display text in several different styles, called faces. Each face can specify various face attributes, such as the font, height, weight, slant, foreground and background color, and underlining or overlining. Most major modes assign faces to the text automatically, via Font Lock mode. c++

注意:face裏並不設定全部屬性,沒有被設定的屬性就使用叫default的face的屬性。好比face:popup-face,它只設定了前景色和背景色屬性,全部它的其餘屬性的值就是face:default的相應屬性的值。微信

這個概念很是重要,因此當改變了face:default裏屬性的值的話,就會影響全部faceapp

list-faces-display :查看系統裏有全部face

list-colors-display :查看系統裏全部的顏色的名字和RGB值

set-face-foreground :改變指定face裏的前景色(先輸入要改變的face的名字,而後再輸入顏色的名字)

set-face-background:改變指定face裏的背景色(先輸入要改變的face的名字,而後再輸入顏色的名字)

ctrl h v 變量A:查看變量A的做用

Font Lock mode:

Font Lock mode is a minor mode, always local to a particular buffer, which assigns faces to (or fontifies) the text in the buffer. Each buffer's major mode tells Font Lock mode which text to fontify; for instance, programming language modes fontify syntactically relevant constructs like comments, strings, and function names.ide

Font Lock mode is enabled by default in major modes that support it. To toggle it in the current buffer, type M-x font-lock-mode.函數

font-lock-mode :做用在當前緩衝區學習

global-font-lock-mode:做用在當前緩衝區字體

Font Lock mode uses several specifically named faces to do its job, including font-lock-string-facefont-lock-comment-face, and others. The easiest way to find them all is to use code

M-x customize-group 回車 font-lock-faces 回車. You can then use that customization buffer to customize the appearance of these faces.

從下圖能夠看出來:

1,關鍵字(font lock keyward face)後面是紫色,因此右面代碼裏關鍵字(template,protected,try等)部分全是紫色

2,函數名(font lock function name face)後面是藍色,因此右面代碼裏函數名(insert,get_node等)部分全是藍色

如何在上面的畫面操做請參考Changing a Variable

c/c++ 學習互助QQ羣:877684253

本人微信:xiaoshitou5854

相關文章
相關標籤/搜索