summaryrefslogtreecommitdiff
path: root/.config/emacs/bd-shells.el
diff options
context:
space:
mode:
authorbd <bdunahu@gmail.com>2024-01-05 02:21:52 -0700
committerbd <bdunahu@gmail.com>2024-01-05 02:21:52 -0700
commitb05329a5092fa19e69fd623548e83dd43eb18e5e (patch)
tree3c303dcb6bc731efb654571fff87aae46fdc1f1e /.config/emacs/bd-shells.el
parent422e24cc41af940ad9fc74a123899c0e4601596e (diff)
Added function to open eshell on top side-window
Diffstat (limited to '.config/emacs/bd-shells.el')
-rw-r--r--.config/emacs/bd-shells.el22
1 files changed, 15 insertions, 7 deletions
diff --git a/.config/emacs/bd-shells.el b/.config/emacs/bd-shells.el
index e6789c5..9f0b919 100644
--- a/.config/emacs/bd-shells.el
+++ b/.config/emacs/bd-shells.el
@@ -1,6 +1,16 @@
;; -*- lexical-binding: t; -*-
+(defun eshell-open-buffer ()
+ "Opens eshell in the bottom
+side window."
+ (interactive)
+ (let ((curr-buffer (current-buffer))
+ (eshell (eshell)))
+ (switch-to-buffer curr-buffer)
+ (display-buffer-in-side-window (get-buffer eshell) '((side . top)))
+ (switch-to-buffer-other-window eshell)))
+
(defun bd/get-prompt-path ()
(abbreviate-file-name (eshell/pwd)))
@@ -17,18 +27,16 @@ status, and path."
(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 (format-time-string " %a, %R") 'face `(:foreground "#888ba5"))
(propertize "\n> " 'face `(:foreground "#c33027")))))
-(current-time-string)
-(format-time-string "%a, %R")
-
(use-package eshell
:init
(require 'magit)
- :bind (:map eshell-mode-map
- ("<tab>" . completion-at-point))
+ :bind (("C-z C-e" . 'eshell-open-buffer)
+ :map eshell-mode-map
+ ("C-q" . 'delete-window) ; mostly for side window
+ ("<tab>" . completion-at-point))
:custom
(eshell-prompt-function 'bd/eshell-prompt)
(eshell-prompt-regexp "^> ")