summaryrefslogtreecommitdiff
path: root/plugins/dircycle/README.md
diff options
context:
space:
mode:
authorKayhan Gültekin <kayhan@gmail.com>2024-07-27 10:38:11 -0400
committerGitHub <noreply@github.com>2024-07-27 16:38:11 +0200
commit06ced8274de7c2edd19cd5be4642bb0ec0772437 (patch)
treec94270ee4714ffea02ecf2ef0daaf2dda05bcea1 /plugins/dircycle/README.md
parentf70e6916a1c9aca77e7bd1b976a3f6100752f0a5 (diff)
downloadzsh-06ced8274de7c2edd19cd5be4642bb0ec0772437.tar.gz
zsh-06ced8274de7c2edd19cd5be4642bb0ec0772437.tar.bz2
zsh-06ced8274de7c2edd19cd5be4642bb0ec0772437.zip
feat(dircycle): add bindings to go up or down in hierarchy (#12291)
Co-authored-by: Marc Cornellà <marc@mcornella.com>
Diffstat (limited to 'plugins/dircycle/README.md')
-rw-r--r--plugins/dircycle/README.md22
1 files changed, 13 insertions, 9 deletions
diff --git a/plugins/dircycle/README.md b/plugins/dircycle/README.md
index 3c9b3a96f..c4105558d 100644
--- a/plugins/dircycle/README.md
+++ b/plugins/dircycle/README.md
@@ -37,13 +37,13 @@ Say you opened these directories on the terminal:
3 ~
```
-By pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd>, the current working directory or `$CWD` will be from `oh-my-zsh` to `Hacktoberfest`. Press it again and it will be at `Projects`.
+By pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd>, the current working directory or `$PWD` will be from `oh-my-zsh` to `Hacktoberfest`. Press it again and it will be at `Projects`.
-And by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd>, the `$CWD` will be from `Projects` to `Hacktoberfest`. Press it again and it will be at `oh-my-zsh`.
+And by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd>, the `$PWD` will be from `Projects` to `Hacktoberfest`. Press it again and it will be at `oh-my-zsh`.
Here's a example history table with the same accessed directories like above:
-| Current `$CWD` | Key press | New `$CWD` |
+| Current `$PWD` | Key press | New `$PWD` |
| --------------- | ----------------------------------------------------- | --------------- |
| `oh-my-zsh` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `Hacktoberfest` |
| `Hacktoberfest` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | `Projects` |
@@ -53,7 +53,7 @@ Here's a example history table with the same accessed directories like above:
| `Hacktoberfest` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `oh-my-zsh` |
| `oh-my-zsh` | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | `~` |
-Note the last traversal, when pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> on a last known `$CWD`, it will change back to the first known `$CWD`, which in the example is `~`.
+Note the last traversal, when pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> on a last known `$PWD`, it will change back to the first known `$PWD`, which in the example is `~`.
Here's an asciinema cast demonstrating the example above:
@@ -61,18 +61,22 @@ Here's an asciinema cast demonstrating the example above:
## Functions
-| Function | Description |
-| -------------------- | --------------------------------------------------------------------------------------------------------- |
-| `insert-cycledleft` | Change `$CWD` to the previous known stack, binded on <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> |
-| `insert-cycledright` | Change `$CWD` to the next known stack, binded on <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> |
+| Function | Description |
+| -------------------- | ------------------------------------------------------------------------------------------------------------------- |
+| `insert-cycledleft` | Change `$PWD` to the previous known stack, bound to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> |
+| `insert-cycledright` | Change `$PWD` to the next known stack, bound to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> |
+| `insert-cycledup` | Change `$PWD` to the parent folder, bound to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Up</kbd> |
+| `insert-cycleddown` | Change `$PWD` to the first alphabetical child folder, bound to <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Down</kbd> |
## Rebinding keys
-You can bind these functions to other key sequences, as long as you know the bindkey sequence. For example, these commands bind to <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> / <kbd>Right</kbd> in `xterm-256color`:
+You can bind these functions to other key sequences, as long as you know the bindkey sequence. For example, these commands bind to <kbd>Alt</kbd> + <kbd>Shift</kbd> + <kbd>key</kbd> in `xterm-256color`:
```zsh
bindkey '^[[1;4D' insert-cycledleft
bindkey '^[[1;4C' insert-cycledright
+bindkey "\e[1;4A" insert-cycledup
+bindkey "\e[1;4B" insert-cycleddown
```
You can get the bindkey sequence by pressing <kbd>Ctrl</kbd> + <kbd>V</kbd>, then pressing the keyboard shortcut you want to use.