diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 305b323..bacbab1 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -75,10 +75,10 @@ Otherwise the startup will be very slow. " (require 'init-persp) ;; (require 'init-window) ;; will be removed (require 'init-treemacs) -;; -;;;; shell -;;(require 'init-eshell) -;; + +;; shell +(require 'init-eshell) + ;;;; markdown ;;(require 'init-markdown) ;;(require 'init-org) diff --git a/.config/emacs/lisp/init-eshell.el b/.config/emacs/lisp/init-eshell.el index f4267de..9fb8cfd 100644 --- a/.config/emacs/lisp/init-eshell.el +++ b/.config/emacs/lisp/init-eshell.el @@ -1,7 +1,7 @@ ;;; init-eshell.el -*- lexical-binding: t -*- ;; Emacs command shell (use-package eshell - :ensure nil + :ensure nil ; built-in :defines eshell-prompt-function :bind (:map eshell-mode-map ([remap recenter-top-bottom] . eshell/clear)) @@ -72,43 +72,52 @@ (eshell-view-file (pop args))))) (defalias 'eshell/more #'eshell/less)) - ;;(defun ju/eshell-prompt () - ;; (let ((current-branch (magit-get-current-branch))) - ;; (concat - ;; "\n" - ;; (propertize (system-name) 'face `(:foreground "#62aeed")) - ;; (propertize " ॐ " 'face `(:foreground "white")) - ;; (propertize (ju/get-prompt-path) 'face `(:foreground "#82cfd3")) - ;; (when current-branch - ;; (concat - ;; (propertize " • " 'face `(:foreground "white")) - ;; (propertize (concat " " current-branch) 'face `(:foreground "#c475f0")))) - ;; (propertize " • " 'face `(:foreground "white")) - ;; (propertize (format-time-string "%I:%M:%S %p") 'face `(:foreground "#5a5b7f")) - ;; (if (= (user-uid) 0) - ;; (propertize "\n#" 'face `(:foreground "red2")) - ;; (propertize "\nλ" 'face `(:foreground "#aece4a"))) - ;; (propertize " " 'face `(:foreground "white"))))) + (defun ju/eshell-prompt () + (let ((current-branch (magit-get-current-branch))) + (concat + "\n" + (propertize (system-name) 'face `(:foreground "#62aeed")) + (propertize " ॐ " 'face `(:foreground "white")) + (propertize (ju/get-prompt-path) 'face `(:foreground "#82cfd3")) + (when current-branch + (concat + (propertize " • " 'face `(:foreground "white")) + (propertize (concat " " current-branch) 'face `(:foreground "#c475f0")))) + (propertize " • " 'face `(:foreground "white")) + (propertize (format-time-string "%I:%M:%S %p") 'face `(:foreground "#5a5b7f")) + (if (= (user-uid) 0) + (propertize "\n#" 'face `(:foreground "red2")) + (propertize "\nλ" 'face `(:foreground "#aece4a"))) + (propertize " " 'face `(:foreground "white")))))) - ;;(setq eshell-prompt-function 'ju/eshell-prompt - ;; eshell-prompt-regexp "^λ ") + ;; (setq eshell-prompt-function 'ju/eshell-prompt + ;; eshell-prompt-regexp "^λ ")) - ;; Display extra information for prompt - (use-package eshell-prompt-extras - :after esh-opt - :defines eshell-highlight-prompt - :autoload (epe-theme-lambda epe-theme-dakrone epe-theme-pipeline) - :init (setq eshell-highlight-prompt t - eshell-prompt-function #'epe-theme-lambda)) +;; Display extra information for prompt +(use-package eshell-prompt-extras + :straight t + :ensure t + :defer t + :after esh-opt + :defines eshell-highlight-prompt + :autoload (epe-theme-lambda epe-theme-dakrone epe-theme-pipeline) + :init (setq eshell-highlight-prompt t + eshell-prompt-function #'epe-theme-lambda)) - ;; `eldoc' support - (use-package esh-help - :init (setup-esh-help-eldoc)) +;; `eldoc' support +(use-package esh-help + :straight t + :ensure t + :defer t + :init (setup-esh-help-eldoc)) - ;; `cd' to frequent directory in `eshell' - (use-package eshell-z - :hook (eshell-mode . (lambda () (require 'eshell-z))))) +;; `cd' to frequent directory in `eshell' +(use-package eshell-z + :straight t + :ensure t + :defer t + :hook (eshell-mode . (lambda () (require 'eshell-z)))) (provide 'init-eshell)