怎么修改modeline , 官方文档里面对modeline的修改存在一些buildin的变量,可以根据内置的变量修改, 但是如果我有新的变量,自定义显示,我需要做什么更改呢,比如我的 变量 定义如下 (if (w32-get-ime-open-status) (setq ime-state “zh-cn”) (setq ime-state “en-us”)) 怎么加在modeline里面呢? mode主题(powerline)
(defun powerline-default-theme ()
"Setup the default mode-line."
(interactive)
(setq-default mode-line-format
'("%e"
(:eval
(let* ((active (powerline-selected-window-active))
(mode-line-buffer-id (if active 'mode-line-buffer-id 'mode-line-buffer-id-inactive))
(mode-line (if active 'mode-line 'mode-line-inactive))
(face0 (if active 'powerline-active0 'powerline-inactive0))
(face1 (if active 'powerline-active1 'powerline-inactive1))
(face2 (if active 'powerline-active2 'powerline-inactive2))
(separator-left (intern (format "powerline-%s-%s"
(powerline-current-separator)
(car powerline-default-separator-dir))))
(separator-right (intern (format "powerline-%s-%s"
(powerline-current-separator)
(cdr powerline-default-separator-dir))))
(lhs (list (powerline-raw "%*" face0 'l)
(when powerline-display-buffer-size
(powerline-buffer-size face0 'l))
(when powerline-display-mule-info
(powerline-raw mode-line-mule-info face0 'l))
(powerline-buffer-id `(mode-line-buffer-id ,face0) 'l)
(when (and (boundp 'which-func-mode) which-func-mode)
(powerline-raw which-func-format face0 'l))
(powerline-raw " " face0)
(funcall separator-left face0 face1)
(when (and (boundp 'erc-track-minor-mode) erc-track-minor-mode)
(powerline-raw erc-modified-channels-object face1 'l))
(powerline-major-mode face1 'l)
(powerline-process face1)
(powerline-minor-modes face1 'l)
(powerline-narrow face1 'l)
(powerline-raw " " face1)
(funcall separator-left face1 face2)
(powerline-vc face2 'r)
(when (bound-and-true-p nyan-mode)
(powerline-raw (list (nyan-create)) face2 'l))))
(rhs (list (powerline-raw global-mode-string face2 'r)
(funcall separator-right face2 face1)
(unless window-system
(powerline-raw (char-to-string #xe0a1) face1 'l))
(powerline-raw "%4l" face1 'l)
(powerline-raw ":" face1 'l)
(powerline-raw "%3c" face1 'r)
(funcall separator-right face1 face0)
(powerline-raw " " face0)
(powerline-raw "%6p" face0 'r)
(if (w32-get-ime-open-status)
(powerline-raw "zh-cn" nil 'r)
(powerline-raw "en-us" nil 'r))
(when powerline-display-hud
(powerline-hud face0 face2))
(powerline-fill face0 0)
)))
(concat (powerline-render lhs)
(powerline-fill face2 (powerline-width rhs))
(powerline-render rhs)))))))
用其他powerline主题的话把(if (w32-get-ime-open-status) (powerline-raw "zh-cn" nil 'r) (powerline-raw "en-us" nil 'r))
放到相应地方就好了,nil
也可以改成想要的face
这种效果是怎么做到的?
这种方式虽然是一种解决方案,但是感觉改动量太大了,有没有比较精简的做法
window-divider-mode 和 awesome-tray
(setq window-divider-default-bottom-width 2
window-divider-default-places (quote bottom-only))
(face-spec-set 'window-divider
'((((background light))
:foreground "#2544bb")
(t
:foreground "#79a8ff"))
'face-override-spec)
(window-divider-mode 1)
(require 'awesome-tray)
(setq awesome-tray-active-modules '("date"))
(setq awesome-tray-input-method-zh-style "ㄓ")
(setq awesome-tray-info-padding-right 2)
(awesome-tray-mode 1)
我没用 powerline
,看了下文档貌似没有提供自定义的参数,只能覆盖了。或者通过mode-line-mule-info
来显示
这个好,这个好 但是melpa 好像没有这个package (awesome-tray)
嗯,懒猫的包,都不上melpa,你要去他的github 上下载。
mode-line-mule-info 依靠这个?说实话,不是很明白,怎么做?
mode-line-mule-info
是用来显示当前输入法状态的。
ps. 突然想起你是用外部输入法的,可能不合适。