projects
/
dotfiles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
43855b4
)
emacs - toggle window maximum
author
Peng Li
<seudut@gmail.com>
Sat, 23 Jul 2016 03:30:58 +0000
(11:30 +0800)
committer
Peng Li
<seudut@gmail.com>
Sat, 23 Jul 2016 03:30:58 +0000
(11:30 +0800)
emacs.d/config.org
patch
|
blob
|
history
diff --git
a/emacs.d/config.org
b/emacs.d/config.org
index
801a072
..
ff8d4ab
100644
(file)
--- a/
emacs.d/config.org
+++ b/
emacs.d/config.org
@@
-2259,6
+2259,14
@@
Most use =C-o C-o= to switch buffers; =C-o x, v= to split window; =C-o o= to del
#+BEGIN_SRC emacs-lisp :tangle yes :results silent
(winner-mode 1)
#+BEGIN_SRC emacs-lisp :tangle yes :results silent
(winner-mode 1)
+ (defun sd/toggle-max-windows ()
+ "Set maximize current if there are multiple windows, if only
+ one window, window undo"
+ (interactive)
+ (if (equal (length (window-list)) 1)
+ (winner-undo)
+ (delete-other-windows)))
+
(defhydra sd/hydra-window (:color red :columns nil)
"window"
("h" windmove-left nil :exit t)
(defhydra sd/hydra-window (:color red :columns nil)
"window"
("h" windmove-left nil :exit t)
@@
-2279,7
+2287,8
@@
Most use =C-o C-o= to switch buffers; =C-o x, v= to split window; =C-o o= to del
(split-window-below)
(windmove-down))
"horz" :exit t)
(split-window-below)
(windmove-down))
"horz" :exit t)
- ("o" delete-other-windows "one" :exit t)
+ ;; ("o" delete-other-windows "one" :exit t)
+ ("o" sd/toggle-max-windows "one" :exit t)
("C-o" ido-switch-buffer "buf" :exit t)
("C-k" sd/delete-current-window "del" :exit t)
("'" other-window "other" :exit t)
("C-o" ido-switch-buffer "buf" :exit t)
("C-k" sd/delete-current-window "del" :exit t)
("'" other-window "other" :exit t)