From 8264114f82179029e41bb4b62269768d8b692791 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Sun, 21 Aug 2022 03:03:56 +0200 Subject: Emacs: Add jd/open-new-vterm --- Emacs.org | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'Emacs.org') diff --git a/Emacs.org b/Emacs.org index 2f25171..c7a67bc 100644 --- a/Emacs.org +++ b/Emacs.org @@ -639,20 +639,15 @@ #+begin_src emacs-lisp - (use-package vterm) - (use-package vterm-toggle - :init - (setq vterm-toggle-fullscreen-p nil) + (defun jd/open-new-vterm () + (interactive) + (let ((buffer-name (generate-new-buffer-name vterm-buffer-name))) + (switch-to-buffer buffer-name) + (vterm-mode))) + + (use-package vterm :config - (add-to-list 'display-buffer-alist - '((lambda (buffer-or-name _) - (let ((buffer (get-buffer buffer-or-name))) - (with-current-buffer buffer - (or (equal major-mode 'vterm-mode) - (string-prefix-p vterm-buffer-name (buffer-name buffer)))))) - (display-buffer-reuse-window display-buffer-at-bottom) - (reusable-frames . visible) - (window-height . 0.3)))) + (setq vterm-buffer-name "vterm")) #+end_src @@ -661,12 +656,10 @@ #+begin_src emacs-lisp (jd/leader-key-def - "oT" '(vterm :which-key "Open terminal in current window") - "ot" '(vterm-toggle :which-key "Toggle terminal")) - + "ot" '(jd/open-new-vterm :which-key "Open terminal in current window")) + #+end_src - ** Dired #+begin_src emacs-lisp -- cgit v1.2.3