* Fixed eshell pwd function

* Minor changes
This commit is contained in:
Vincent Ambo 2013-08-17 20:43:05 +02:00
parent 996c5867e6
commit 15f83cc78f
3 changed files with 7 additions and 11 deletions

View file

@ -12,7 +12,7 @@
'(haskell-mode-hook '(haskell-mode-hook
(quote (quote
(capitalized-words-mode turn-on-haskell-decl-scan turn-on-haskell-doc turn-on-hi2))) (capitalized-words-mode turn-on-haskell-decl-scan turn-on-haskell-doc turn-on-hi2)))
'(it-mode-google-cmd "/usr/local/share/python/google") '(it-mode-google-cmd "/usr/local/bin/google")
'(ns-alternate-modifier (quote none)) '(ns-alternate-modifier (quote none))
'(ns-command-modifier (quote meta)) '(ns-command-modifier (quote meta))
'(require-final-newline (quote visit-save))) '(require-final-newline (quote visit-save)))

View file

@ -27,8 +27,10 @@
(defun clean-pwd (path) (defun clean-pwd (path)
"Turns a path of the form /foo/bar/baz into /f/b/baz "Turns a path of the form /foo/bar/baz into /f/b/baz
(inspired by fish shell)" (inspired by fish shell)"
(message path) (let* ((hpath (replace-regexp-in-string home-dir
(let* ((current-dir (split-string path "/")) "~"
path))
(current-dir (split-string hpath "/"))
(cdir (last current-dir)) (cdir (last current-dir))
(head (butlast current-dir))) (head (butlast current-dir)))
(concat (mapconcat (lambda (s) (concat (mapconcat (lambda (s)
@ -39,13 +41,6 @@
(if head "/" nil) (if head "/" nil)
(car cdir)))) (car cdir))))
(setq eshell-pwd-convert-function
(lambda (path)
(clean-pwd (replace-regexp-in-string
home-dir
"~"
path))))
(defun vcprompt (&optional args) (defun vcprompt (&optional args)
"Call the external vcprompt command with optional arguments. "Call the external vcprompt command with optional arguments.
VCPrompt" VCPrompt"
@ -59,7 +54,7 @@
(defun prompt-f () (defun prompt-f ()
"My EShell prompt displaying VC info and such" "My EShell prompt displaying VC info and such"
(concat (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") (with-face (vcprompt " -f \"(%s:%b%a%m) \"") :foreground "#5f627f")
(if (= 0 (user-uid)) (if (= 0 (user-uid))
(with-face "#" :foreground "#f43841") (with-face "#" :foreground "#f43841")

View file

@ -120,6 +120,7 @@ comment as a filename."
;; Not the real deal without this ... ;; Not the real deal without this ...
(set-variable 'nyan-wavy-trail t) (set-variable 'nyan-wavy-trail t)
;; Style line numbers (shown with M-g g)
(setq linum-format (lambda (line) (setq linum-format (lambda (line)
(propertize (propertize
(format (concat " %" (format (concat " %"