diff options
author | Thanos Apollo <[email protected]> | 2024-12-28 16:45:12 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-12-28 16:45:12 +0200 |
commit | 34e204e5ddb51384405743c06639abe435eff6b3 (patch) | |
tree | 09a0bdc08acc18f70cb23f1e657b67f66f64642b | |
parent | 84a25db788e35ddf1e5de63e52346ef80e5ee3a5 (diff) |
emacs: Add thanos/shell
* Add function to launch shell similar to how eshell works.
-rw-r--r-- | .config/emacs/init.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 9fd76a3..77ef8ea 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -605,14 +605,23 @@ :config (setf eshell-visual-commands nil eat-term-name "xterm-256color") - :bind (("C-c v" . eat)) + :bind (("C-c V" . eat)) :hook ((eshell-mode . eat-eshell-mode) (eshell-mode . eat-eshell-visual-command-mode) (eat-mode . (lambda () (visual-line-mode -1))))) (use-package shell :ensure t - :bind (("C-c V" . shell) + :config + (defun thanos/shell (n) + "Create or switch to a shell buffer." + (interactive "P") + (let* ((num (if n (prefix-numeric-value n) nil)) + (buf-name (if num + (format "*shell<%d>*" num) + "*shell*"))) + (shell buf-name))) + :bind (("C-c v" . thanos/shell) :map shell-mode-map ("C-l" . 'comint-clear-buffer)) :hook ((shell-mode . (lambda () (display-line-numbers-mode -1))))) |