better laptop prompt!
This commit is contained in:
parent
5afc2cc4a1
commit
61076597d2
1 changed files with 17 additions and 1 deletions
|
|
@ -57,10 +57,26 @@
|
||||||
()
|
()
|
||||||
(display-batteries))
|
(display-batteries))
|
||||||
|
|
||||||
|
(def _fancy-cwd 'prints (up to) last three segments of current path'
|
||||||
|
()
|
||||||
|
(let ((cdir (load-to-string pwd))
|
||||||
|
(dir-segs (split cdir '/'))
|
||||||
|
(dir-iter (dq dir-segs))
|
||||||
|
(i 0))
|
||||||
|
(if (lte? (len dir-segs) 4)
|
||||||
|
cdir
|
||||||
|
(let ((final ""))
|
||||||
|
(while (lt? i 3)
|
||||||
|
(set (q final) (concat "/" (car dir-iter) final))
|
||||||
|
(set (q dir-iter) (dq (cdr dir-iter)))
|
||||||
|
(inc i))
|
||||||
|
(concat "..." final)))))
|
||||||
|
|
||||||
(def CFG_RELISH_L_PROMPT 'display user and dir (git info in future)'
|
(def CFG_RELISH_L_PROMPT 'display user and dir (git info in future)'
|
||||||
()
|
()
|
||||||
(concat
|
(concat
|
||||||
"[" USER "] "
|
"[" USER "] "
|
||||||
(load-to-string basename (load-to-string pwd)) " "
|
(_fancy-cwd) " "
|
||||||
;; add more prompt elements here
|
;; add more prompt elements here
|
||||||
|
"\n" ;; newline before delimiter
|
||||||
))
|
))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue