From c10469952399d3e68045e23fed4e4cfcb9becb47 Mon Sep 17 00:00:00 2001 From: Lucas Sta Maria Date: Thu, 14 Nov 2024 17:01:58 -0500 Subject: [PATCH] fix(emacs): create and use new `priime-terminal` command Signed-off-by: Lucas Sta Maria --- .emacs.d/include/priime-convenience.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.emacs.d/include/priime-convenience.el b/.emacs.d/include/priime-convenience.el index 6af4c91..998065e 100644 --- a/.emacs.d/include/priime-convenience.el +++ b/.emacs.d/include/priime-convenience.el @@ -26,13 +26,18 @@ (write-file file-path) (find-file (expand-file-name file-path)))) +(defun priime-terminal () + "Open a terminal in the current project or current directory." + (interactive) + (if (projectile-project-p) + (projectile-run-vterm) + (vterm))) + (defun priime-split-terminal () "Split a terminal on the right and move to it." (interactive) (priime-split-right) - (if (projectile-project-p) - (projectile-run-vterm) - (vterm)) + (priime-terminal) (balance-windows)) (use-package projectile :straight t @@ -54,7 +59,7 @@ (use-package no-littering :straight t) (use-package vterm :straight t :custom (vterm-shell (or (executable-find "fish") shell-file-name)) - :bind (("C-c v" . vterm) + :bind (("C-c v" . priime-terminal) ("" . priime-split-terminal))) (use-package rg :straight t) (use-package anzu :straight t