diff --git a/modules/nixos/programs/emacs/init.el b/modules/nixos/programs/emacs/init.el index b1b0947..2a296e1 100644 --- a/modules/nixos/programs/emacs/init.el +++ b/modules/nixos/programs/emacs/init.el @@ -617,19 +617,26 @@ (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)) (use-package vterm - :init - (add-to-list 'display-buffer-alist - '("\\*vterm*" - (display-buffer-at-bottom)))) -(use-package vterm-toggle :init (defun gg/vterm-new () (interactive) - (vterm-toggle--new)) + (vterm 'new)) + (defun gg/vterm-new-with-name (buffer-name) + (interactive "MName for vterm buffer: ") + (other-window -1) ;; Hack, because the window takes up the fullscreen if we invoke `vterm' from the minibuffer + (vterm (format "*vterm-%s*" buffer-name))) + (add-to-list 'display-buffer-alist + '("\\*vterm*" + (display-buffer-at-bottom))) :general (gg/leader - "o o" #'vterm-toggle-cd "o n" #'gg/vterm-new + "o N" #'gg/vterm-new-with-name)) + +(use-package vterm-toggle + :general + (gg/leader + "o o" #'vterm-toggle "o j" #'vterm-toggle-forward "o k" #'vterm-toggle-backward))