From d43710ba0c01fc031e1138e6391fee0264a82696 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Sat, 11 Apr 2026 08:47:46 +0200 Subject: [PATCH] Refactor multi-vterm launch commands --- dotfiles/desktop/.emacs.d/lisp/core/keybindings.el | 2 +- .../desktop/.emacs.d/lisp/misc/custom-functions.el | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/dotfiles/desktop/.emacs.d/lisp/core/keybindings.el b/dotfiles/desktop/.emacs.d/lisp/core/keybindings.el index db2ca40..55843e0 100644 --- a/dotfiles/desktop/.emacs.d/lisp/core/keybindings.el +++ b/dotfiles/desktop/.emacs.d/lisp/core/keybindings.el @@ -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)) diff --git a/dotfiles/desktop/.emacs.d/lisp/misc/custom-functions.el b/dotfiles/desktop/.emacs.d/lisp/misc/custom-functions.el index 6f81b9d..becdc80 100644 --- a/dotfiles/desktop/.emacs.d/lisp/misc/custom-functions.el +++ b/dotfiles/desktop/.emacs.d/lisp/misc/custom-functions.el @@ -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."