From: Peng Li Date: Mon, 25 May 2015 16:46:22 +0000 (+0800) Subject: emacs: mode-line add default-directory display on mode-line X-Git-Url: http://47.100.26.94:8080/?a=commitdiff_plain;h=716c2a73961c719c1ed490ee594689357a647632;p=dotfiles.git emacs: mode-line add default-directory display on mode-line --- diff --git a/emacs.d/config/init-color-theme.el b/emacs.d/config/init-color-theme.el index 978a771..d2da41b 100644 --- a/emacs.d/config/init-color-theme.el +++ b/emacs.d/config/init-color-theme.el @@ -131,6 +131,11 @@ "+1" "+2" "FlyC" "Fly" ;; ":1/0" "Fill" "AC" "FIC") "\\|")) "" s)) +(defun powerline-format-default-directory (s) + (if s + (replace-regexp-in-string "/Users/peli3/" "~/" s) + s)) + (defun powerline-ha-theme () "A powerline theme that removes many minor-modes that don't serve much purpose on the mode-line." (interactive) @@ -176,7 +181,11 @@ (list (funcall separator-right face1 mode-line) (powerline-raw (concat "%3c, %l/" (format "%d" (count-lines (point-min) (point-max))) " %4p ") mode-line) - (funcall separator-right mode-line face1) + (funcall separator-right mode-line face-blue) + (powerline-raw " [" face-blue) + (powerline-raw (powerline-format-default-directory default-directory) face-blue ) + (powerline-raw "] " face-blue) + (funcall separator-right face-blue face1) (powerline-raw (format-time-string " %m-%d") face1 'r) (funcall separator-right face1 face-yel) (powerline-raw (format-time-string " %I:%M %p %a ") face-yel 'r))) diff --git a/emacs.d/init.el b/emacs.d/init.el index dec8eb3..c0cc477 100644 --- a/emacs.d/init.el +++ b/emacs.d/init.el @@ -36,7 +36,7 @@ (elscreen-start) (require 'init-elscreen) (require 'init-color-theme) -;(require 'init-my-theme-2) + ;--------------------------------------------------------------------------------------- ;; Ido