emacs: mode-line add default-directory display on mode-line
authorPeng Li <seudut@gmail.com>
Mon, 25 May 2015 16:46:22 +0000 (00:46 +0800)
committerPeng Li <seudut@gmail.com>
Mon, 25 May 2015 16:46:22 +0000 (00:46 +0800)
emacs.d/config/init-color-theme.el
emacs.d/init.el

index 978a771..d2da41b 100644 (file)
                                   "+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)
                             (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)))
index dec8eb3..c0cc477 100644 (file)
@@ -36,7 +36,7 @@
 (elscreen-start)
 (require 'init-elscreen)
 (require 'init-color-theme)
-;(require 'init-my-theme-2)
+
 
 ;---------------------------------------------------------------------------------------
 ;; Ido