Created
October 23, 2019 10:01
-
-
Save hjiang/f3a1a08a93fbfa85dc59d9a48cf98950 to your computer and use it in GitHub Desktop.
Smart split for Emacs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun smart-split () | |
| "Split the frame into 80-column sub-windows, and make sure no window has | |
| fewer than 80 columns." | |
| (interactive) | |
| (cl-lables ((smart-split-helper (lambda (w) | |
| (if (> (window-width w) (* 2 81)) | |
| (let ((w2 (split-window w 82 t))) | |
| (smart-split-helper w2)))))) | |
| (smart-split-helper nil))) | |
| (smart-split) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment