summaryrefslogtreecommitdiff
path: root/.config/emacs/bd-shells.el
diff options
context:
space:
mode:
authorbd <bdunahu@gmail.com>2024-01-05 00:35:05 -0700
committerbd <bdunahu@gmail.com>2024-01-05 00:35:05 -0700
commit749d18a05af98a51d468ffebd7b0e27b86a7d3cb (patch)
tree004ef25a42e1fec67a807a414ff813657f4aa810 /.config/emacs/bd-shells.el
parent294bf3860e3e0b8b68a41c42a9050d700463e38b (diff)
eshell cosmetic changes
Diffstat (limited to '.config/emacs/bd-shells.el')
-rw-r--r--.config/emacs/bd-shells.el33
1 files changed, 33 insertions, 0 deletions
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
+ ("<tab>" . 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")))