Refactor multi-vterm launch commands

This commit is contained in:
Fabio Scotto di Santolo
2026-04-11 08:47:46 +02:00
parent d8fc6d7984
commit d43710ba0c
2 changed files with 12 additions and 3 deletions

View File

@@ -44,7 +44,7 @@
;; -------- vterm --------
(autoload 'multi-vterm "multi-vterm" nil t)
(define-key fscotto/open (kbd "T") #'multi-vterm)
(define-key fscotto/open (kbd "T") #'fscotto/home-multi-vterm)
(with-eval-after-load 'vterm
(define-key vterm-mode-map (kbd "C-c C-t") #'vterm-copy-mode))

View File

@@ -23,11 +23,20 @@
(let ((default-directory (fscotto/project-root)))
(vterm)))
(defun fscotto/open-multi-vterm-in (directory)
"Open a new multi-vterm buffer in DIRECTORY."
(let ((default-directory (file-name-as-directory directory)))
(multi-vterm)))
(defun fscotto/home-multi-vterm ()
"Open a new multi-vterm buffer in HOME."
(interactive)
(fscotto/open-multi-vterm-in (expand-file-name "~/")))
(defun fscotto/project-multi-vterm ()
"Open a new multi-vterm buffer in project root."
(interactive)
(let ((default-directory (fscotto/project-root)))
(multi-vterm)))
(fscotto/open-multi-vterm-in (fscotto/project-root)))
(defun fscotto/launch-external-terminal (&optional command)
"Launch external terminal in project root, optionally running COMMAND."