Compare commits
4 Commits
1502872174
...
3294ba546e
Author | SHA1 | Date | |
---|---|---|---|
3294ba546e | |||
2de038abaf | |||
5d0f344d59 | |||
71bf2d1cca |
24
p11k.el
24
p11k.el
@ -1,8 +1,8 @@
|
|||||||
;;; p11k.el --- PowerLevel10k prompt for Eshell -*- lexical-binding: t; -*-
|
;;; p11k.el --- PowerLevel10k prompt for Eshell -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;; Copyright (C) 2023 Mitchell Marquez
|
;; Copyright (C) 2023 Miranda Marquez
|
||||||
|
|
||||||
;; Author: Mitchell Marquez <dr.m.perseos@gmail.com>
|
;; Author: Miranda Marquez <mirmarq428@gmail.com>
|
||||||
;; Keywords: terminals, convenience, faces
|
;; Keywords: terminals, convenience, faces
|
||||||
;; Package-Requires: ((dash) (all-the-icons) (eshell-prompt-extras) (f) (shrink-path))
|
;; Package-Requires: ((dash) (all-the-icons) (eshell-prompt-extras) (f) (shrink-path))
|
||||||
|
|
||||||
@ -242,12 +242,15 @@ Use 'window-width' to calculate the total final width."
|
|||||||
it) nil)))
|
it) nil)))
|
||||||
(branch (--> "git branch"
|
(branch (--> "git branch"
|
||||||
(shell-command-to-string it)
|
(shell-command-to-string it)
|
||||||
(split-string it "\n" 'omit-nulls search-whitespace-regexp)
|
(split-string it)
|
||||||
(if it (progn
|
(cadr it)
|
||||||
(--filter (string-match-p (rx bol "* " (+ word)) it) it)
|
;; (split-string it "\n" 'omit-nulls search-whitespace-regexp)
|
||||||
(split-string (car it))
|
;; (if it (progn
|
||||||
(cadr it))
|
;; (--filter (string-match-p (rx bol "* " (+ word)) it) it)
|
||||||
"")))
|
;; (split-string (car it))
|
||||||
|
;; (cadr it))
|
||||||
|
;; "")
|
||||||
|
))
|
||||||
(modcount (--> status-alist
|
(modcount (--> status-alist
|
||||||
(--map (car it) it)
|
(--map (car it) it)
|
||||||
(--count (string-match-p "M" it) it)
|
(--count (string-match-p "M" it) it)
|
||||||
@ -262,7 +265,7 @@ Use 'window-width' to calculate the total final width."
|
|||||||
nil))))
|
nil))))
|
||||||
(p11k/spaced-concat
|
(p11k/spaced-concat
|
||||||
(if (eq p11k/prompt-flow 'fluent) "on" "")
|
(if (eq p11k/prompt-flow 'fluent) "on" "")
|
||||||
(propertize branch 'face 'p11k/green)
|
(if branch (propertize branch 'face 'p11k/green) "")
|
||||||
(if modcount (propertize modcount 'face 'p11k/yellow) "")
|
(if modcount (propertize modcount 'face 'p11k/yellow) "")
|
||||||
(if untracked (propertize untracked 'face 'p11k/blue) "")))
|
(if untracked (propertize untracked 'face 'p11k/blue) "")))
|
||||||
""))
|
""))
|
||||||
@ -300,6 +303,7 @@ Use 'window-width' to calculate the total final width."
|
|||||||
"Toggle the direction that the prompt points according to `p11k/get-modal-status'."
|
"Toggle the direction that the prompt points according to `p11k/get-modal-status'."
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(save-mark-and-excursion
|
(save-mark-and-excursion
|
||||||
|
(if (re-search-backward eshell-prompt-regexp nil 'no-error)
|
||||||
(let ((inhibit-read-only t)
|
(let ((inhibit-read-only t)
|
||||||
(new-caret
|
(new-caret
|
||||||
(p11k/caret-color-status
|
(p11k/caret-color-status
|
||||||
@ -308,7 +312,7 @@ Use 'window-width' to calculate the total final width."
|
|||||||
(re-search-backward eshell-prompt-regexp)
|
(re-search-backward eshell-prompt-regexp)
|
||||||
(goto-char (point-at-bol))
|
(goto-char (point-at-bol))
|
||||||
(delete-forward-char 1)
|
(delete-forward-char 1)
|
||||||
(insert new-caret))
|
(insert new-caret)))
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(defun p11k/esh-transient-prompt ()
|
(defun p11k/esh-transient-prompt ()
|
||||||
|
Loading…
Reference in New Issue
Block a user