一个小设置:改变 eshell 的提示符

Linux大全评论405 views阅读模式

下面的小配置让 eshell 的 prompt 最多只显示最后 4 个文件夹名。

;; change eshell prompt

(defun yami-adjust-eshell-prompt (path)

(let* ( (path-components (split-string path "/"))

(len (length path-components))

(max-comp 4) )

(if (<= len max-comp)

path

(concat "<< " (mapconcat (lambda (str) str)

(nthcdr (- len max-comp) path-components)

"/")))))

(setq eshell-prompt-function

(lambda ()

(concat (yami-adjust-eshell-prompt (eshell/pwd))

(if (= (user-uid) 0) " # " " $ "))))

傻傻的效果,凑合着用先

<< download/emacs/admin/charsets # ls

CVS compact.awk eucjp-ms.awk kuten.awk

Makefile cp51932.awk gb180302.awk mapconv

big5.awk cp932.awk gb180304.awk mule-charsets.el

企鹅博客
  • 本文由 发表于 2020年8月11日 14:56:49
  • 转载请务必保留本文链接:https://www.qieseo.com/130613.html

发表评论