about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--config.org15
1 files changed, 5 insertions, 10 deletions
diff --git a/config.org b/config.org index 84a9cd4..9e1d21c 100644 --- a/config.org +++ b/config.org
@@ -150,18 +150,13 @@ and have made a custom fringe bitmap.
150 150
151** Windows 151** Windows
152 152
153*** Switch to other window or buffer 153*** Splitting windows sensibly
154 154
155I grabbed this from [[https://www.reddit.com/r/emacs/comments/kz347f/what_parts_of_your_config_do_you_like_best/gjlnp2c/][u/astoff1]]: it extends the =other-window= command 155This is extremely fiddly and I'd love another option.
156to switch to the other buffer if there's only one window in the frame.
157 156
158#+begin_src emacs-lisp :noweb-ref functions 157#+begin_src emacs-lisp :noweb-ref settings
159 (defun other-window-or-buffer () 158 (setq-default split-width-threshold 80
160 "Switch to other window, or the previous buffer." 159 split-height-threshold 50)
161 (interactive)
162 (if (eq (count-windows) 1)
163 (switch-to-buffer nil)
164 (other-window 1)))
165#+end_src 160#+end_src
166 161
167*** Switch to other window or buffer :crux: 162*** Switch to other window or buffer :crux: