diff --git a/.emacs.bankruptcy/init.org b/.emacs.bankruptcy/init.org index 715fb11..3c07493 100644 --- a/.emacs.bankruptcy/init.org +++ b/.emacs.bankruptcy/init.org @@ -335,7 +335,7 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun (if (> (window-width) 170) joe/popper-side-toggle 'below)) - +;; TODO Consider adding checks for vertical splits and only popup on right if so (defun joe/popper-display-func (buffer &optional _alist) (display-buffer-in-direction buffer @@ -496,8 +496,23 @@ Vertico Embark Marginalia Consult Orderless (setq vterm-timer-delay 0.01) (setq vterm-buffer-name-string "VTerm - %s") (setq vterm-max-scrollback 100000) +(setq vterm-kill-buffer-on-exit t) + +(defun joe/close-popup-buffer (vterm-buf event-msg) + (unless (or (eq popper-popup-status nil) + (eq popper-popup-status 'raised)) + (popper-close-latest))) + +(setq vterm-exit-functions '(joe/close-popup-buffer)) + +(defun joe/vterm-here () + (interactive) + (let ((vterm-buf (vterm--internal #'switch-to-buffer))) + (with-current-buffer vterm-buf + (setq popper-popup-status 'raised)))) (global-set-key (kbd "C-c t") #'vterm) +(global-set-key (kbd "C-c T") #'joe/vterm-here) (add-hook 'vterm-mode-hook (lambda () (setq-local global-hl-line-mode nil))) #+end_src