好久没写过博客了,今天来一炮 ...
Emacs 的UI实在太难看了,正巧碰到一款还不错的ui美化产品,很用心了,在这个高手看不上和不重视这等细节的时代,努力的工作就交给我们这些小白吧,哈哈 ...
1. 效果图如下
2. 具体实现
插件地址: https://github.com/milkypostman/powerline
图形界面和终端界面确实风格迥异,为了和谐只能自己定制一下了。
;; desc: powerline
;; mode: emacs-powerline
;; link: https://github.com/jonathanchu/emacs-powerline
;; -----------------------
(require 'powerline)
(defun graphic-powerline-config ()
"powerline setting for graphic"
(interactive)
(progn
(setq powerline-arrow-shape 'arrow)
(custom-set-faces
'(mode-line ((t (:foreground "white" :background "#0044cc" :box nil))))
'(mode-line-inactive ((t (:foreground "white" :background "#262626" :box nil))))
)
(setq powerline-color1 "#0088cc")
(setq powerline-color2 "white")
)
)
(defun terminal-powerline-config()
" powerline setting for terminal"
(interactive)
(setq powerline-arrow-shape 'arrow)
(setq powerline-color1 "grey22")
(setq powerline-color2 "grey22")
(custom-set-faces
'(mode-line ((t (:foreground "grey44" :background "grey22" :box nil))))
'(mode-line-inactive ((t (:foreground "grey22" :background "grey44" :box nil))))
))
;; "根据是否图形界面加载配置"
;;(if (display-graphic-p)
;; (graphic-powerline-config)
;; (terminal-powerline-config))
我用的是 milkypostman/powerline 的插件,代码里面link 是补地址时后来搜索到的,貌似排名更靠前,但都兼容 ...