elscreen标签背景颜色

使用emacs过程中,配合evil使用,按照tab的划分,将编辑、浏览、leetcode等任务划分到不同的tab便于切换及管理。美中不足的是,模拟标签的elscreen默认将其他标签的颜色设置成:background blue :foreground black的配色,每次切换任务时,都需要重复确认需要跳转到哪个标签,就比较麻烦了。查找了一下重置face-attribute的方法,备注下。

在初始文件的最后添加:

1
2
3
4
5
;; 选中标签设置为绿底黑字,其他标签为黄底黑字
(set-face-attribute 'elscreen-tab-other-screen-face nil
                    :background "yellow" :foreground "black")
(set-face-attribute 'elscreen-tab-current-screen-face nil
                    :background "green" :foreground "black")

备注下elscreen原始代码:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
(defface elscreen-tab-current-screen-face
  '((((class color))
     (:background "white" :foreground "black"))
    (t (:underline t)))
  "Face for current screen tab."
  :group 'elscreen)

(defface elscreen-tab-other-screen-face
  '((((type x w32 mac ns) (class color))
     :background "Gray85" :foreground "Gray50")
    (((class color))
     (:background "blue" :foreground "black" :underline t)))
  "Face for tabs other than current screen one."
  :group 'elscreen)

emacs defface

Hello, World!
使用 Hugo 构建
主题 StackJimmy 设计