Skip to content

Commit

Permalink
feat(emacs): add gg/vterm-new-with-name function
Browse files Browse the repository at this point in the history
  • Loading branch information
gekoke committed Oct 4, 2024
1 parent 5d42db9 commit b389123
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions modules/nixos/programs/emacs/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit b389123

Please sign in to comment.