Skip to content

Instantly share code, notes, and snippets.

@drcode
Created April 18, 2017 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drcode/21ae3a66d47d0cffe4539c9b8d34897a to your computer and use it in GitHub Desktop.
Save drcode/21ae3a66d47d0cffe4539c9b8d34897a to your computer and use it in GitHub Desktop.
(defun split-window-multiple-ways (x y)
"Split the current frame into a grid of X columns and Y rows."
(interactive "nColumns: \nnRows: ")
;; one window
(delete-other-windows)
(dotimes (i (1- x))
(split-window-horizontally)
(dotimes (j (1- y))
(split-window-vertically))
(other-window y))
(dotimes (j (1- y))
(split-window-vertically))
(balance-windows))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment