Skip to content

Instantly share code, notes, and snippets.

@tam17aki
Created October 25, 2014 03:51
Show Gist options
  • Save tam17aki/a5311989a9ceb8f789ca to your computer and use it in GitHub Desktop.
Save tam17aki/a5311989a9ceb8f789ca to your computer and use it in GitHub Desktop.
(require 'cl-lib)
(cl-defun split-window-vertically-n (&optional (num_wins 1))
(interactive "p")
(cond ((<= num_wins 2)
(split-window-below))
(t
(split-window-below
(- (window-height) (/ (window-height) num_wins)))
(split-window-vertically-n (- num_wins 1)))))
(cl-defun split-window-horizontally-n (&optional (num_wins 1))
(interactive "p")
(cond ((<= num_wins 2)
(split-window-right))
(t
(split-window-right
(- (window-width) (/ (window-width) num_wins)))
(split-window-horizontally-n (- num_wins 1)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment