chiark / gitweb /
el/dot-emacs.el: Experimental tweaking for the Emacs shell.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 15 Dec 2009 14:41:05 +0000 (14:41 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 15 Dec 2009 14:41:05 +0000 (14:41 +0000)
Now Emacs is my shell.  Truly, I shall not want.

el/dot-emacs.el

index 4d82b1a3e8dc2413bf1566dde53f309f03fc7201..0d0a7d760568ffd446c28d3ce3e603df974da585 100644 (file)
@@ -2053,6 +2053,32 @@ (defun mdw-setup-sh-script-mode ()
   (setq sh-indentation 2)
   (setq sh-basic-offset 2))
 
+;;;--------------------------------------------------------------------------
+;;; Emacs shell mode.
+
+(defun mdw-eshell-prompt ()
+  (let ((left "[") (right "]"))
+    (when (= (user-uid) 0)
+      (setq left "«" right "»"))
+    (concat left
+           (save-match-data
+             (replace-regexp-in-string "\\..*$" "" (system-name)))
+           " "
+           (eshell/pwd)
+           right)))
+(setq eshell-prompt-function 'mdw-eshell-prompt)
+(setq eshell-prompt-regexp "^\\[[^]]+\\]")
+
+(mdw-define-face eshell-prompt (t :weight bold))
+(mdw-define-face eshell-ls-archive (t :weight bold :foreground "red"))
+(mdw-define-face eshell-ls-backup (t :foreground "lightgrey" :slant italic))
+(mdw-define-face eshell-ls-product (t :foreground "lightgrey" :slant italic))
+(mdw-define-face eshell-ls-clutter (t :foreground "lightgrey" :slant italic))
+(mdw-define-face eshell-ls-executable (t :weight bold))
+(mdw-define-face eshell-ls-directory (t :foreground "cyan" :weight bold))
+(mdw-define-face eshell-ls-readonly (t nil))
+(mdw-define-face eshell-ls-symlink (t :foreground "cyan"))
+
 ;;;--------------------------------------------------------------------------
 ;;; Messages-file mode.