jixiuf / vterm-toggle

toggles between the vterm buffer and whatever buffer you are editing.
GNU General Public License v3.0
189 stars 12 forks source link

Enable switching back-and-forth between buffers #20

Closed MicahElliott closed 3 years ago

MicahElliott commented 3 years ago

It's be nice to have a way to "toggle" without closing the vterm buffer. It's nice to just jump back-and-forth between vterm and a code buffer.

jixiuf commented 3 years ago
(setq vterm-toggle-hide-method nil)
MicahElliott commented 3 years ago

Thanks @jixiuf . But even after setting that in init.el to nil and restarting emacs and verifying that it's nil, my vterm buffer still disappears when I call vterm-toggle when focus is on the vterm buffer.

It seems like vterm-toggle-hide is being called in this case and causing it to hide: https://github.com/jixiuf/vterm-toggle/blob/master/vterm-toggle.el#L125

My workaround is to have another binding to:

(defun my-vterm-other ()
  (interactive)
  (select-window (get-buffer-window (vterm-toggle--recent-other-buffer))))

which is what I think this should be doing, but I haven't been able to trace why. https://github.com/jixiuf/vterm-toggle/blob/master/vterm-toggle.el#L166

jixiuf commented 3 years ago

It's weird, it works on my Mac.

MicahElliott commented 3 years ago

I'll write this off as something wrong/interfering with my personal config. Thanks for looking and for the tool!