From 749d18a05af98a51d468ffebd7b0e27b86a7d3cb Mon Sep 17 00:00:00 2001 From: bd Date: Fri, 5 Jan 2024 00:35:05 -0700 Subject: eshell cosmetic changes --- .config/emacs/bd-shells.el | 33 +++++++++++++++++++++++++++++++++ .config/emacs/images/raven.png | Bin 0 -> 1125362 bytes .config/emacs/init.el | 1 + 3 files changed, 34 insertions(+) create mode 100644 .config/emacs/bd-shells.el create mode 100644 .config/emacs/images/raven.png diff --git a/.config/emacs/bd-shells.el b/.config/emacs/bd-shells.el new file mode 100644 index 0000000..4e3a7b4 --- /dev/null +++ b/.config/emacs/bd-shells.el @@ -0,0 +1,33 @@ +;; -*- lexical-binding: t; -*- + + +(use-package term + :config + (defalias 'term 'ansi-term)) + +(use-package eshell + :demand + :after (magit all-the-icons) + :init + (defun bd/get-prompt-path () + (abbreviate-file-name (eshell/pwd))) + + (defun bd/eshell-prompt () + (let ((current-branch (magit-get-current-branch))) + (concat + "\n" + (propertize (system-name) 'face `(:foreground "#edb54b")) + (when current-branch + (concat + (format " %s " (all-the-icons-octicon "git-branch")) + (propertize current-branch 'face `(:foreground "#98d1ce")))) + (format " %s " (all-the-icons-fileicon "gn")) + (propertize (bd/get-prompt-path) 'face `(:foreground "#33859d")) + (propertize "\n> " 'face `(:foreground "#c33027"))))) + :bind (:map eshell-mode-map + ("" . completion-at-point)) + :custom + (eshell-prompt-function 'bd/eshell-prompt) + (eshell-prompt-regexp "^> ") + (eshell-scroll-to-bottom-on-input 'this) + (eshell-banner-message (concat "\n" (propertize " " 'display (create-image (expand-file-name "~/.config/emacs/images/raven.png") 'png nil :scale 0.2 :align-to "center")) "\n"))) diff --git a/.config/emacs/images/raven.png b/.config/emacs/images/raven.png new file mode 100644 index 0000000..21c64bc Binary files /dev/null and b/.config/emacs/images/raven.png differ diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 4fe9b04..9d9e674 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -16,5 +16,6 @@ (load (expand-file-name "~/.config/emacs/bd-development.el")) (load (expand-file-name "~/.config/emacs/bd-wm.el")) (load (expand-file-name "~/.config/emacs/bd-mode-and-themes.el")) +(load (expand-file-name "~/.config/emacs/bd-shells.el")) (setopt gc-cons-threshold 800000) -- cgit v1.2.3