Skip to content

Commit ea90493

Browse files
committed
Stack forward/backward movements
Update: - readme.md
1 parent c25aea7 commit ea90493

File tree

2 files changed

+412
-69
lines changed

2 files changed

+412
-69
lines changed

readme.md

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

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

121142
## Create windows ##
122143

123144
Here, we want to create a bunch of windows. We can use `2` and `3` to
124145
make splits like their native emacs commands `C-x 2` and `C-x 3`. Use
125146
`0` to kill the split. If you want to go down to a single, use the
126-
example above to hit `k` to kill all and then `y` to restore. Again,
127-
all of the buffer resizing commands work (`f`, `p`, `b`, `n`) to
128-
resize these buffers.
147+
example above to hit `k` to kill all and then `>` or `<` to restore.
148+
Again, all of the buffer resizing commands work (`f`, `p`, `b`, `n`)
149+
to resize these buffers.
129150

130151
![usage gif](images/navigate.gif)
131152

0 commit comments

Comments
 (0)