From 91b77006de59a859de07c5895df459f8472580a4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 18 Jan 2021 23:20:46 -0600 Subject: Change M-o binding to switch buffers too --- config.org | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'config.org') diff --git a/config.org b/config.org index a04bd01..d5fb7da 100644 --- a/config.org +++ b/config.org @@ -289,10 +289,19 @@ (winner-mode +1)) #+end_src -**** Switch windows +**** Switch windows or buffers if one window + +from [[https://www.reddit.com/r/emacs/comments/kz347f/what_parts_of_your_config_do_you_like_best/gjlnp2c/][u/astoff1]]. #+begin_src emacs-lisp - (global-set-key (kbd "M-o") #'other-window) + (defun acdw/other-window-or-buffer () + "Switch to other window, or previous buffer." + (interactive) + (if (eq (count-windows) 1) + (switch-to-buffer nil) + (other-window 1))) + + (global-set-key (kbd "M-o") #'acdw/other-window-or-buffer) #+end_src **** Pop-up windows -- cgit 1.4.1-21-gabe81