Skip to content

Commit 4800445

Browse files
committed
Stack forward/backward movements
Window configurations stack utility functions. Suspend the notification if the minibuffer is active by suggestion of Dan Sutton (see `resize-window--notify'). Offers better compatibility with `ivy-switch-buffer' and commands which employ the minibuffer. Update: - readme.md
1 parent f2d4602 commit 4800445

File tree

2 files changed

+478
-68
lines changed

2 files changed

+478
-68
lines changed

readme.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ panes. Use `W` to cycle in the opposite direction.
4848
- `0`: Delete the current window.
4949
- `k`: Delete other windows and save the state on the stack.
5050
- `s`: Save the state on the stack so you may restore it later.
51-
- `y`: Restore to a previous saved state.
51+
- `>`: Restore to a previous saved state. Use `<` to restore in the
52+
opposite direction.
5253
- `?`: Display the help menu listing commands.
5354

5455
The best part of this is that resize-window keeps listening for more
@@ -121,17 +122,37 @@ In this example, we can bounce back and forth between the test and
121122
code of resize-window. When we want to work in one exclusively, we
122123
call up resize-window (bound with `C-c ;` and then hit `k` for kill
123124
all the other windows. We edit our tests and then call up
124-
resize-window and hit `y` for yank. Think that we just put them into a
125-
ring buffer, but they are actually in a stack.
125+
resize-window and hit `>` restore to a succeding saved state or `<`
126+
for a preceding one. Think that we just put them into a ring buffer,
127+
but they are actually in a stack.
128+
129+
## The window configurations stack ##
130+
131+
The stack is a customizable size holder for window configurations. It
132+
folds over. Moving after the end restarts from the beginning and vice
133+
versa. Old configurations are dropped due to a chosen reduction in its
134+
size or an exceding number of configurations saved.
135+
136+
Move forward/backward via `>` and `<` (to avoid pressing a modifier
137+
key, you may consider `,` and `.` as possible alternatives).
138+
Originally I was using `r` and `R` to move in the stack...
139+
140+
Special flags give hints about the direction followed, forward `>` or
141+
backward `<`, and if the current window configuration is modified `*`
142+
or not `=` (aka saved in the stack at the current position).
143+
144+
When a configuration is modified, adjacent positions in the stack are
145+
considered to see if such new configuration is already there. In such
146+
a case, modification flag and direction followed are set accordingly.
126147

127148
## Create windows ##
128149

129150
Here, we want to create a bunch of windows. We can use `2` and `3` to
130151
make splits like their native emacs commands `C-x 2` and `C-x 3`. Use
131152
`0` to kill the split. If you want to go down to a single, use the
132-
example above to hit `k` to kill all and then `y` to restore. Again,
133-
all of the buffer resizing commands work (`f`, `p`, `b`, `n`) to
134-
resize these buffers.
153+
example above to hit `k` to kill all and then `>` or `<` to restore.
154+
Again, all of the buffer resizing commands work (`f`, `p`, `b`, `n`)
155+
to resize these buffers.
135156

136157
![usage gif](images/navigate.gif)
137158

0 commit comments

Comments
 (0)