I've finally taken the plunge and started to write simple functions for small actions I want to automate. I was able to make a function to switch to a vterm buffer in another window and or create one if it doesn't exist (same as built in vterm function) but also switch back from that vterm window (which the vterm baked in function can't do) Is this the best practice for switching / finding buffers? I'm pretty green on elisp and have just been digging through help docs / other plugins. Any help / advice is appreciated!
(defun find-term (lis)
"find terminal and switch to term buffer"
(cond
((eq '() lis)
(vterm-other-window))
((string= (car lis) "*vterm*")
(switch-to-buffer-other-window (car lis)))
(t
(find-term (cdr lis)))))
(defun switch-to-vterm ()
"switch to or from vterm window"
(interactive)
(let
((bufs (mapcar #'buffer-name (buffer-list))))
(if
(string= "*vterm*" (buffer-name))
;; true
(other-window 1)
;; false
(find-term bufs))))