]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
adding twist-split
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 26 Feb 2016 13:05:44 +0000 (14:05 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 26 Feb 2016 13:08:55 +0000 (14:08 +0100)
- Switch between horizontal and vertical split screen.

bba.org

diff --git a/bba.org b/bba.org
index e2463b98543b2c62c64f5e91ac1c4e91ebead060..744e5f533cbd5be3721d51928346d2c798bbf05f 100644 (file)
--- a/bba.org
+++ b/bba.org
@@ -1803,6 +1803,18 @@ Bind shift f3 and shift f4 to previous/next frame.
   (global-set-key (kbd "S-<f4>") 'move-cursor-next-frame)
 #+END_SRC
 
+Right from [[https://gist.github.com/etherald/dcdcf579751c75a2c796][gisthub]]:
+
+#+BEGIN_SRC emacs-lisp
+  (defun twist-split ()
+    (interactive)
+    (setq buffer2 (window-buffer (second (window-list))))
+    (if (window-top-child (frame-root-window))
+    (progn (delete-other-windows) (split-window-horizontally))
+    (progn (delete-other-windows) (split-window-vertically)))
+    (set-window-buffer (second (window-list)) buffer2))
+#+END_SRC
+
 * [[https://github.com/dotemacs/ipcalc.el][ipcalc]]
 #+BEGIN_SRC emacs-lisp
       (require 'ipcalc)