Skip to content

Commit b275e58

Browse files
committed
Reorganize the list of commands
Update: - readme.md - test/resize-window-test.el
1 parent 15c08f0 commit b275e58

File tree

3 files changed

+36
-38
lines changed

3 files changed

+36
-38
lines changed

readme.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,16 @@ lines at once.
3737
for 5 lines at once.
3838
- `b`: Resize the window horizontally like scrolling backward. Use `B`
3939
for 5 lines at once.
40-
- `r`: reset window layout to standard
41-
- `w`: cycle through windows so that you can adjust other window
42-
panes. `W` cycles in the opposite direction.
43-
- `2`: create a new horizontal split
44-
- `3`: create a new vertical split
45-
- `0`: delete the current window
46-
- `k`: kill all buffers and put window config on the stack
40+
- `w`: Cycle through windows so that you can adjust other window
41+
panes. Use `W` to cycle in the opposite direction.
42+
- `e`: Even the size of the windows.
43+
- `2`: Split the window horizontally.
44+
- `3`: Split the window vertically.
45+
- `0`: Delete the current window.
46+
- `k`: Delete other windows and save the state on the stack.
4747
- `s`: Save the state on the stack so you may restore it later.
48-
- `y`: make the window configuration according to the last config
49-
pushed onto the stack
50-
- `?`: Display menu listing commands
48+
- `r`: Restore to a previous saved state.
49+
- `?`: Display the help menu listing commands.
5150

5251
The best part of this is that resize-window keeps listening for more
5352
keystrokes until it doesn't recognize input. So you don't have to make

resize-window.el

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;;; resize-window.el --- easily resize windows -*- lexical-binding: t; -*-
1+
;;; resize-window.el --- Easily resize windows -*- lexical-binding: t; -*-
22

33
;; Copyright (C) 2015 Free Software Foundation, Inc.
44

@@ -28,13 +28,13 @@
2828
;; Easily allows you to resize windows. Rather than guessing that you
2929
;; want `C-u 17 C-x {`, you could just press FFff, which resizes 5
3030
;; lines, then 5 lines, then one and then one. The idea is that the
31-
;; normal motions n,p,f,b along with r for reset and w for cycling
31+
;; normal motions n,p,f,b along with e for even and w for cycling
3232
;; windows allows for super simple resizing of windows. All of this is
3333
;; inside of a while loop so that you don't have to invoke more chords
3434
;; to resize again, but just keep using standard motions until you are
3535
;; happy.
3636

37-
;; But, just run `M-x resize-window`. There are only a few commands to learn,
37+
;; Just run `M-x resize-window`. There are only a few commands to learn,
3838
;; and they mimic the normal motions in emacs.
3939

4040
;; n : Resize the window vertically like scrolling down.
@@ -45,17 +45,16 @@
4545
;; F for 5 lines at once.
4646
;; b : Resize the window horizontally like scrolling backward.
4747
;; B for 5 lines at once.
48-
;; r : reset window layout to standard
49-
;; w : cycle through windows so that you can adjust other window
50-
;; panes. W cycles in the opposite direction.
51-
;; 2 : create a new horizontal split
52-
;; 3 : create a new vertical split
53-
;; 0 : delete the current window
54-
;; k : kill all buffers and put window config on the stack
48+
;; w : Cycle through windows so that you can adjust other window panes.
49+
;; W cycle in the opposite direction.
50+
;; e : Even the size of the windows.
51+
;; 2 : Split the window horizontally.
52+
;; 3 : Split the window vertically.
53+
;; 0 : Delete the current window.
54+
;; k : Delete other windows and save the state on the stack.
5555
;; s : Save the state on the stack so you may restore it later.
56-
;; y : make the window configuration according to the last config
57-
;; pushed onto the stack
58-
;; ? : Display menu listing commands
56+
;; r : Restore to a previous saved state.
57+
;; ? : Display the help menu listing commands.
5958

6059

6160
;;; Code:
@@ -136,20 +135,20 @@ should return the fine adjustment (default 1)."
136135
resize-window-coarse-argument))
137136

138137
(defvar resize-window-dispatch-alist
139-
'((?n resize-window--resize-downward " Resize - downward" t)
140-
(?p resize-window--resize-upward " Resize - upward" t)
141-
(?f resize-window--resize-forward " Resize - forward" t)
142-
(?b resize-window--resize-backward " Resize - backward" t)
143-
(?r resize-window--reset-windows " Resize - reset window layout (save state)" nil)
144-
(?w resize-window--cycle-window-positive " Resize - cycle window" nil)
145-
(?W resize-window--cycle-window-negative " Resize - cycle window" nil)
146-
(?2 resize-window--split-window-below " Split window horizontally (save state)" nil)
147-
(?3 resize-window--split-window-right " Slit window vertically (save state)" nil)
148-
(?0 resize-window--delete-window " Delete window (save state)" nil)
149-
(?k resize-window--kill-other-windows " Kill other windows (save state)" nil)
150-
(?s resize-window--window-push " Save state" nil)
151-
(?y resize-window--restore-windows " (when state) Restore window configuration" nil)
152-
(?? resize-window--display-menu " Resize - toggle help menu" nil))
138+
'((?n resize-window--resize-downward "Resize downward" t)
139+
(?p resize-window--resize-upward "Resize upward" t)
140+
(?f resize-window--resize-forward "Resize forward" t)
141+
(?b resize-window--resize-backward "Resize backward" t)
142+
(?w resize-window--cycle-window-positive "Next window" nil)
143+
(?W resize-window--cycle-window-negative "Previous window" nil)
144+
(?e resize-window--reset-windows "Even layout (save state)" nil)
145+
(?2 resize-window--split-window-below "Split below (save state)" nil)
146+
(?3 resize-window--split-window-right "Split right (save state)" nil)
147+
(?0 resize-window--delete-window "Delete window (save state)" nil)
148+
(?k resize-window--kill-other-windows "Delete other windows (save state)" nil)
149+
(?s resize-window--window-push "Save state" nil)
150+
(?r resize-window--restore-windows "Restore state" nil)
151+
(?? resize-window--display-menu "Toggle help menu" nil))
153152
"List of resize mode bindings.
154153
Main data structure of the dispatcher with the form:
155154
\(key function documentation allows-capitals\)")

test/resize-window-test.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@
5858
(resize-window-lowercase-argument)))))
5959

6060
(ert-deftest resize-window--key-already-used-tests ()
61-
(should (resize-window--key-available? ?e))
61+
(should (resize-window--key-available? ?v))
6262
(should-not (resize-window--key-available? ?n)))

0 commit comments

Comments
 (0)