The functions I have found for splitting windows are (split-window-right)
and (split-window-below)
. When these are evaluated the cursor ends up in the right window in the case of (split-window-right)
or the upper window in the case of (split-window-below)
.
I want to have functions that split a window and puts the cursor in the right or lower window.
I wrote the following myself, but it unfortunately does not move the cursor as I expected. Instead it just behaves as if (split-window-right)
was called by itself.
(defun olav-split-window-left ()
(interactive)
(split-window-right)
(windmove-right))
M-x olav-split-window-left
, it works for me as expected: it splits the window into two side-by-side windows and the window on the right is selected.window-splitting
(and other window tags). I'm guessing many are similar or essentially the same. Would someone like to take a look and maybe consolidate as a community question or two?