Configure eat and eshell-p10k

This commit is contained in:
2024-09-15 22:59:03 -07:00
parent 6aeb14a9eb
commit bb1b8ecd05

View File

@@ -35,17 +35,56 @@
(keymap-global-set "C-c o r" #'copy-source-for-reddit)
(use-package eshell
:config
(setq eshell-destroy-buffer-when-process-dies t))
(use-package eat
:ensure t
:custom
(eat-term-name "xterm-256color")
:init
(add-hook 'eshell-load-hook #'eat-eshell-mode)
(add-hook 'eshell-load-hook #'eat-eshell-visual-command-mode)
:hook (eat-mode . (lambda () (setq display-line-numbers nil))))
(eval-after-load 'eshell #'eat-eshell-mode)
(eval-after-load 'eshell #'eat-eshell-visual-command-mode)
:hook (eat-mode . (lambda ()
(setq display-line-numbers nil)
(hl-line-mode -1))))
(use-package eshell
:config
(setq eshell-destroy-buffer-when-process-dies t))
(use-package eshell-toggle
:ensure t
:custom
(eshell-toggle-size-fraction 2)
(eshell-toggle-window-side 'below)
:bind (("M-`" . eshell-toggle)))
(use-package eshell-p10k
:ensure (:host github :repo "elken/eshell-p10k")
:config
(eshell-p10k-def-segment time
""
(format-time-string "%H:%M" (current-time))
'eshell-p10k-distro-face)
(defun num-exitcode-string ()
(if (= eshell-last-command-status 0)
(number-to-string eshell-p10k--prompt-num-index)
(format "%d (%d)" eshell-p10k--prompt-num-index eshell-last-command-status)))
(defun num-exitcode-face ()
(if (= eshell-last-command-status 0)
'eshell-p10k-git-clean-face
'eshell-p10k-git-dirty-face))
(eshell-p10k-def-segment num-exitcode
""
(num-exitcode-string)
(num-exitcode-face))
(defun eshell-p10k-prompt-function ()
"Prompt defining function."
(eshell-p10k-def-prompt '(num-exitcode time dir git)))
(setq eshell-prompt-function #'eshell-p10k-prompt-function
eshell-prompt-regexp eshell-p10k-prompt-string))
(use-package lsp-mode
:ensure t