diff options
author | Vincent Ambo <vincent@Vincents-MacBook-Pro.local> | 2013-08-17T18·43+0200 |
---|---|---|
committer | Vincent Ambo <vincent@Vincents-MacBook-Pro.local> | 2013-08-17T18·43+0200 |
commit | 15f83cc78f9776e9c63a57f681c60608221a7758 (patch) | |
tree | f934c53eb5fb9a338931074d134df4801f4265e7 /init-eshell.el | |
parent | 996c5867e6bcb871348f914e460f0d82729d268e (diff) |
* Fixed eshell pwd function
* Minor changes
Diffstat (limited to 'init-eshell.el')
-rw-r--r-- | init-eshell.el | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/init-eshell.el b/init-eshell.el index 58c5888512e8..77f99e551a14 100644 --- a/init-eshell.el +++ b/init-eshell.el @@ -27,8 +27,10 @@ (defun clean-pwd (path) "Turns a path of the form /foo/bar/baz into /f/b/baz (inspired by fish shell)" - (message path) - (let* ((current-dir (split-string path "/")) + (let* ((hpath (replace-regexp-in-string home-dir + "~" + path)) + (current-dir (split-string hpath "/")) (cdir (last current-dir)) (head (butlast current-dir))) (concat (mapconcat (lambda (s) @@ -39,13 +41,6 @@ (if head "/" nil) (car cdir)))) -(setq eshell-pwd-convert-function - (lambda (path) - (clean-pwd (replace-regexp-in-string - home-dir - "~" - path)))) - (defun vcprompt (&optional args) "Call the external vcprompt command with optional arguments. VCPrompt" @@ -59,7 +54,7 @@ (defun prompt-f () "My EShell prompt displaying VC info and such" (concat - (with-face (concat (eshell/pwd) " ") :foreground "#96a6c8") + (with-face (concat (clean-pwd (eshell/pwd)) " ") :foreground "#96a6c8") (with-face (vcprompt " -f \"(%s:%b%a%m) \"") :foreground "#5f627f") (if (= 0 (user-uid)) (with-face "#" :foreground "#f43841") |