From 422e24cc41af940ad9fc74a123899c0e4601596e Mon Sep 17 00:00:00 2001 From: bd Date: Fri, 5 Jan 2024 00:58:12 -0700 Subject: Added time string to eshell prompt --- .config/emacs/bd-default.el | 6 +++--- .config/emacs/bd-emms.el | 6 +++--- .config/emacs/bd-shells.el | 48 ++++++++++++++++++++++++++------------------- 3 files changed, 34 insertions(+), 26 deletions(-) (limited to '.config/emacs') diff --git a/.config/emacs/bd-default.el b/.config/emacs/bd-default.el index 9e5f69f..7d86347 100644 --- a/.config/emacs/bd-default.el +++ b/.config/emacs/bd-default.el @@ -42,8 +42,8 @@ open URL at point." (global-unset-key (kbd "C-z")) (global-unset-key (kbd "C-x C-z")) ; terrible binding -(global-set-key (kbd "C-c =") 'text-scale-increase) -(global-set-key (kbd "C-c -") 'text-scale-decrease) +(global-set-key (kbd "C-z =") 'text-scale-increase) +(global-set-key (kbd "C-z -") 'text-scale-decrease) (setopt inhibit-startup-message t) (menu-bar-mode -1) @@ -86,7 +86,7 @@ open URL at point." ;;;; built-in packages (use-package newsticker :demand t - :bind (("C-c C-n" . newsticker-show-news) + :bind (("C-z C-n" . newsticker-show-news) :map newsticker-treeview-item-mode-map ("C-j" . rip-video)) :custom diff --git a/.config/emacs/bd-emms.el b/.config/emacs/bd-emms.el index cc414ab..573f275 100644 --- a/.config/emacs/bd-emms.el +++ b/.config/emacs/bd-emms.el @@ -20,9 +20,9 @@ playback." (emms-shuffle)) (use-package emms - :bind (("C-c C-m" . 'emms-open-playlist-buffer) - ("C-c C-p" . 'emms-play-playlist) - ("C-c C-s" . 'emms-quickstart)) + :bind (("C-z C-m" . 'emms-open-playlist-buffer) + ("C-z C-p" . 'emms-play-playlist) + ("C-z C-s" . 'emms-quickstart)) :config (emms-all) (add-to-list 'emms-info-functions 'emms-info-functions 'emms-info-mpd) diff --git a/.config/emacs/bd-shells.el b/.config/emacs/bd-shells.el index 4e3a7b4..e6789c5 100644 --- a/.config/emacs/bd-shells.el +++ b/.config/emacs/bd-shells.el @@ -1,29 +1,32 @@ ;; -*- lexical-binding: t; -*- -(use-package term - :config - (defalias 'term 'ansi-term)) +(defun bd/get-prompt-path () + (abbreviate-file-name (eshell/pwd))) + +(defun bd/eshell-prompt () + "Assemble a shell prompt including host, git +status, and path." + (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")) + (format " %s " (all-the-icons-material "watch_later")) + (propertize (format-time-string "%a, %R") 'face `(:foreground "#888ba5")) + (propertize "\n> " 'face `(:foreground "#c33027"))))) + +(current-time-string) +(format-time-string "%a, %R") (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"))))) + (require 'magit) :bind (:map eshell-mode-map ("" . completion-at-point)) :custom @@ -31,3 +34,8 @@ (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"))) + + +(use-package term + :config + (defalias 'term 'ansi-term)) -- cgit v1.2.3