diff --git a/.config/emacs/config.el b/.config/emacs/config.el index 05117bf..39e4561 100644 --- a/.config/emacs/config.el +++ b/.config/emacs/config.el @@ -308,6 +308,7 @@ "e F" '(ediff-files3 :wk "Run ediff on three files") "e h" '(counsel-esh-history :which-key "Eshell history") "e l" '(eval-last-sexp :wk "Evaluate elisp expression before point") + "e n" '(eshell-new :wk "Create new eshell buffer") "e r" '(eval-region :wk "Evaluate elisp in region") "e R" '(eww-reload :which-key "Reload current page in EWW") "e s" '(eshell :which-key "Eshell") @@ -664,10 +665,20 @@ ;; Disabling company mode in eshell, because it's annoying. (setq company-global-modes '(not eshell-mode)) +;; Adding a keybinding for 'pcomplete-list' on F9 key. (add-hook 'eshell-mode-hook (lambda () (define-key eshell-mode-map (kbd "") #'pcomplete-list))) +;; A function for easily creating multiple buffers of 'eshell'. +;; NOTE: `C-u M-x eshell` would also create new 'eshell' buffers. +(defun eshell-new (name) + "Create new eshell buffer named NAME." + (interactive "sName: ") + (setq name (concat "$" name)) + (eshell) + (rename-buffer name)) + (use-package eshell-toggle :custom (eshell-toggle-size-fraction 3) diff --git a/.config/emacs/config.org b/.config/emacs/config.org index 566580c..2c365df 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -464,6 +464,7 @@ You can use the bindings CTRL plus =/- for zooming in/out. You can also use CTR "e F" '(ediff-files3 :wk "Run ediff on three files") "e h" '(counsel-esh-history :which-key "Eshell history") "e l" '(eval-last-sexp :wk "Evaluate elisp expression before point") + "e n" '(eshell-new :wk "Create new eshell buffer") "e r" '(eval-region :wk "Evaluate elisp in region") "e R" '(eww-reload :which-key "Reload current page in EWW") "e s" '(eshell :which-key "Eshell") @@ -965,6 +966,15 @@ Eshell is an Emacs 'shell' that is written in Elisp. (lambda () (define-key eshell-mode-map (kbd "") #'pcomplete-list))) +;; A function for easily creating multiple buffers of 'eshell'. +;; NOTE: `C-u M-x eshell` would also create new 'eshell' buffers. +(defun eshell-new (name) + "Create new eshell buffer named NAME." + (interactive "sName: ") + (setq name (concat "$" name)) + (eshell) + (rename-buffer name)) + (use-package eshell-toggle :custom (eshell-toggle-size-fraction 3)