4

I am using Doom Emacs, and I frequently use the vterm popup/toggle functionality (defined as +vterm/toggle here, which is used, as the name suggests, to toggle a vterm buffer.

The default behavior is to toggle from the bottom of the screen, but I'd like it to toggle from the right side of my screen if possible.

Drew
  • 75,699
  • 9
  • 109
  • 225
Jacob Pavlock
  • 261
  • 1
  • 8

3 Answers3

6

Credit to @henrik:

You need to use a popup rule. The default is defined here:

(set-popup-rule! "^vterm" :size 0.25 :vslot -4 :select t :quit nil :ttl 0)

Just add side: right and have the regex match the buffer you want, in this case *doom:vterm-popup:main and put this in your config.el inside an after! vterm block.

So, the final result for my case was:

; config.el
(after! vterm
  (set-popup-rule! "*doom:vterm-popup:main" :size 0.25 :vslot -4 :select t :quit nil :ttl 0 :side 'right)
  )

For more info on popup-rules, see the doom docs.

Jacob Pavlock
  • 261
  • 1
  • 8
0

Just few notes to @jacob-pavlock answer.

If you receiving error, Invalid side 'right specified, you need to remove the ' character.

; config.el
(after! vterm
  (set-popup-rule! "*doom:vterm-popup:main" :size 0.25 :vslot -4 :select t :quit nil :ttl 0 :side right)
  )
0

The accepted answer only adds that behavior to projects named main (or when no project is selected).

Use :* to have that for all projects

   ; config.el
(after! vterm
  (set-popup-rule! "*doom:vterm-popup:*" :size 0.25 :vslot -4 :select t :quit nil :ttl 0 :side 'right)
  )