Skip to content

Commit

Permalink
docs: add more examples for the cd command
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Jul 26, 2024
1 parent 103a34e commit 6ae50a2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 11 deletions.
30 changes: 30 additions & 0 deletions docs/configuration/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,36 @@ Change the current directory.
| `[path]` | The path to change to. |
| `--interactive` | Use an interactive UI to input the path. |

You can add your own `g` series keys to achieve a simple bookmark feature:

```toml
[[manager.prepend_keymap]]
on = [ "g", "d" ],
run = "cd ~/Downloads"
desc = "Cd to ~/Downloads"

[[manager.prepend_keymap]]
on = [ "g", "p" ],
run = "cd ~/Pictures"
desc = "Cd to ~/Pictures"
```

For Windows users, you can also switch drives using the `cd` command (Nightly version of Yazi required atm):

```toml
[[manager.prepend_keymap]]
on = [ "g", "d" ],
run = "cd D:"
desc = "Switch to D drive"

[[manager.prepend_keymap]]
on = [ "g", "p" ],
run = 'cd "E:\\Pictures"' # We need to escape the backslash
desc = 'Cd to E:\Pictures'
```

Check out the [resources page](/docs/resources) for a more comprehensive bookmark plugin.

### `reveal` {#manager.reveal}

Change the current directory to the parent of specified file, and hover on it.
Expand Down
6 changes: 3 additions & 3 deletions docs/image-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ Now you should be able to enjoy with the image preview.

Zellij currently only supports the Sixel graphics format, so you will need a terminal that also supports Sixel.

Note that, the image rendering in Zellij has some performance issues, causing noticeable lagginess when quickly switching between images,
and sometimes even [image tearing](https://github.com/zellij-org/zellij/issues/2576#issuecomment-1707107473).
Note that, Zellij's Sixel implementation is quite buggy and has serious performance issues at the moment,
causing noticeable lagginess when quickly switching between images, and sometimes even [image tearing](https://github.com/zellij-org/zellij/issues/2576#issuecomment-1707107473).

These issues won't be improved until Zellij enhances it's Sixel implementation or [provides a passthrough mode](https://github.com/zellij-org/zellij/issues/775), if the image is a stronger need to you, consider running Yazi outside of Zellij or using Überzug++.
These issues won't be improved until Zellij enhances it's Sixel implementation or [provides a passthrough mode](https://github.com/zellij-org/zellij/issues/775). If the image is a stronger need to you, consider running Yazi outside of Zellij or using Überzug++.

## Windows users {#windows}

Expand Down
16 changes: 8 additions & 8 deletions docs/plugins/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ local url = Url("archive:///root/ost.zip#bgm.mp3")

Properties:

- `frag` - The fragment string of this url. Let's say the url `archive:///root/my-archive.zip#1.jpg`, the fragment `1.jpg`
- `is_regular` - Whether the file represented by this url is a regular file
- `is_search` - Whether the file represented by this url from the search result
- `is_archive` - Whether the file represented by this url from an archive
- `frag` - The fragment string of the url. Let's say the url `archive:///root/my-archive.zip#1.jpg`, the fragment `1.jpg`
- `is_regular` - Whether the file represented by the url is a regular file
- `is_search` - Whether the file represented by the url from the search result
- `is_archive` - Whether the file represented by the url from an archive

Methods:

- `name()` - The file name of this url
- `stem()` - The file name without the extension of this url
- `join(url)` - Join this url with another url
- `parent()` - The url of the parent directory
- `name()` - Returns the filename in string if any, otherwise `nil`
- `stem()` - Returns the filename without the extension in string if any, otherwise `nil`
- `join(url)` - Joins with another url or a string of url, returns a new `Url`
- `parent()` - Returns parent directory in string if any, otherwise `nil`

Meta methods:

Expand Down

0 comments on commit 6ae50a2

Please sign in to comment.