Skip to content

Commit

Permalink
docs: split searching from file operations
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Jan 19, 2024
1 parent d30b003 commit 2ccb570
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docs/plugins/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Properties:
- `cwd` - The current working directory of this folder, which is a [Url](#url)
- `offset` - The offset of this folder, which is an integer
- `cursor` - The cursor position of this folder, which is an integer
- `window` - A table of [File](#file)s in the visible area of this folder
- `files` - The [Files](#folderfiles) of this folder
- `window` - A table of [File](#file) in the visible area of this folder
- `files` - The [`folder::Files`](#folderfiles) of this folder
- `hovered` - The hovered [File](#file) of this folder, or `nil` if there is no hovered file

### `folder::Files`
Expand Down
8 changes: 5 additions & 3 deletions docs/plugins/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ return {

### Previewer

A previewer needs to return a table that implements the `peek` and `seek` functions. Both functions take a table parameter `self` and do not return any values:

```lua
return {
peek = function(self) return end,
seek = function(self) return end,
}
```

A previewer needs to return an table that implements the `peek` and `seek` functions. Both functions take a table parameter `self` and do not return any values.

When the user presses `j` or `k` to switch between hovering files, `peek` is called, with:

- `file`: The [File](./common.md#file) to be previewed.
Expand All @@ -124,6 +124,8 @@ Here are some preset previewers and preloaders you can refer to: [Yazi Preset Pl

### Preloader

You need to return a table that implements the `preload` function, it receives a `self` parameter, which is a table with the same fields as [`peek`](#previewer):

```lua
return {
preload = function(self)
Expand All @@ -132,7 +134,7 @@ return {
}
```

You need to return an table that implements the `preload` function, it receives a `self` parameter, which is a table with the same fields as [`peek`](#previewer). It has the following return values:
And has the following return values:

| Binary | Decimal | |
| ------ | ------- | ----------------------- |
Expand Down
29 changes: 17 additions & 12 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ For all key bindings, see the [default `keymap.toml` file](https://github.com/sx
### Navigation
To navigate between files and directories you can use the arrow keys ``, ``, `` and `` or vi(m)-like commands such as `h`, `j`, `k`, `l`:
To navigate between files and directories you can use the arrow keys ``, ``, `` and `` or Vim-like commands such as `h`, `j`, `k`, `l`:
| Key binding | Alternate key | Action |
| ----------- | ------------- | ----------------------------------------------- |
| k || Move the cursor up |
| j || Move the cursor down |
| l || Enter highlighted directory |
| l || Enter hovered directory |
| h || Leave the current directory and into its parent |
Further navigation commands can be found in the table below.
Expand All @@ -113,14 +113,14 @@ Further navigation commands can be found in the table below.
To select files and directories, the following commands are available.
| Key binding | Action |
| ----------- | ---------------------------------------------- |
| \<Space> | Toggle selection of highlighted file/directory |
| v | Enter visual mode (selection mode) |
| V | Enter visual mode (unset mode) |
| \<Ctrl-a> | Select all files |
| \<Ctrl-r> | Inverse selection of all files |
| \<Esc> | Cancel selection |
| Key binding | Action |
| ----------- | ------------------------------------------ |
| \<Space> | Toggle selection of hovered file/directory |
| v | Enter visual mode (selection mode) |
| V | Enter visual mode (unset mode) |
| \<Ctrl-a> | Select all files |
| \<Ctrl-r> | Inverse selection of all files |
| \<Esc> | Cancel selection |
### File/directory operations
Expand All @@ -145,8 +145,6 @@ To interact with selected files/directories use any of the commands below.
| ; | Run a shell command |
| : | Run a shell command (block the UI until the command finishes) |
| . | Toggle the visibility of hidden files |
| s | Search files by name using fd |
| S | Search files by content using ripgrep |
| \<Ctrl-s> | Cancel the ongoing search |
| z | Jump to a directory using zoxide |
| Z | Jump to a directory, or reveal a file using fzf |
Expand Down Expand Up @@ -179,6 +177,13 @@ _Observation: `c ⇒ d` indicates pressing the `c` key followed by pressing the
| n | Jump to next occurrence |
| N | Jump to previous occurrence |
### Searching files/directories
| Key binding | Action |
| ----------- | ------------------------------------------------------------------------------ |
| s | Search files by name using [fd](https://github.com/sharkdp/fd) |
| S | Search files by content using [ripgrep](https://github.com/BurntSushi/ripgrep) |
### Sorting
To sort files/directories use the following commands.
Expand Down

0 comments on commit 2ccb570

Please sign in to comment.