From de42bb4c87a43d3426e768778bf7c3cc7b4beae8 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:07:02 -0500 Subject: [PATCH] refactor: convert lists into tables, make all commands headings --- docs/configuration/keymap.md | 540 +++++++++++++++++++++++------------ 1 file changed, 364 insertions(+), 176 deletions(-) diff --git a/docs/configuration/keymap.md b/docs/configuration/keymap.md index e4c280356..8f6483fb1 100644 --- a/docs/configuration/keymap.md +++ b/docs/configuration/keymap.md @@ -9,288 +9,476 @@ description: Learn how to configure keyboard shortcuts with Yazi. If you haven't created and used your own configuration file yet, please see [Configuration](./overview.md). ::: -## [manager] +## `[manager]` -- escape: Cancel find, exit visual mode, clear selected, cancel filter, or cancel search. +### `escape` - - `--all`: Do all of the above. - - `--find`: Cancel find. - - `--visual`: Exit visual mode. - - `--select`: Clear selected. - - `--filter`: Cancel filter. - - `--search`: Cancel search. +Cancel find, exit visual mode, clear selected, cancel filter, or cancel search. - Automatically determine the operation by default, and it will only execute the selected operation after specifying the option; multiple options can be stacked. +| Options/Arguments | Description | +| ----------------- | -------------------- | +| `--all` | Do all of the above. | +| `--all` | Do all of the above. | +| `--find` | Cancel find. | +| `--visual` | Exit visual mode. | +| `--select` | Clear selected. | +| `--filter` | Cancel filter. | +| `--search` | Cancel search. | -- quit: Exit the process. +Automatically determine the operation by default, and it will only execute the selected operation after specifying the option; multiple options can be stacked. - - `--no-cwd-file`: Don't write the current directory to the `cwd-file`. +### `quit` -- close: Close the current tab; if it's the last tab, exit the process instead. +Exit the process. -### Navigation +| Options/Arguments | Description | +| ----------------- | ---------------------------------------------------- | +| `--no-cwd-file` | Don't write the current directory to the `cwd-file`. | -- arrow +### `close` - - `n` / `n%`: Move the cursor up or down by `n` or `n%` lines. Use negative values to move up and positive values to move down. +Close the current tab; if it's the last tab, exit the process instead. -- leave: Go back to the parent directory. -- enter: Enter the child directory. -- back: Go back to the previous directory. -- forward: Go forward to the next directory. -- seek +### `arrow` - - `n`: Seek up or down at file contents in the preview. Use negative values to peek up and positive values to peek down. +| Options/Arguments | Description | +| ----------------- | ----------------------------------------------------------------------------------------------------------------- | +| `[n \| n%]` | Move the cursor up or down by `n` or `n%` lines. Use negative values to move up and positive values to move down. | -- cd: Change the current directory. +### `leave` - - `path`: the path to change to. - - `--interactive`: Use an interactive UI to input the path. +Go back to the parent directory. -- reveal: Change the current directory to the parent of specified file, and hover on it. +### `enter` - - `path`: the path to reveal. +Enter the child directory. -### Selection +### `back` -- select +Go back to the previous directory. - - `--state=true`: Select the current file. - - `--state=false`: Deselect the current file. - - `--state=none`: Default, toggle the selection state of the current file. +### `forward` -- select_all +Go forward to the next directory. - - `--state=true`: Select all files. - - `--state=false`: Deselect all files. - - `--state=none`: Default, toggle the selection state of all files. +### `seek` -- visual_mode: Enter visual mode (selection mode). +| Options/Arguments | Description | +| ----------------- | ----------------------------------------------------------------------------------------------------------------- | +| `[n]` | Seek up or down at file contents in the preview. Use negative values to peek up and positive values to peek down. | - - `--unset`: Enter visual mode (unset mode). +### `cd` -### Operation +Change the current directory. -- open: Open the selected files. +| Options/Arguments | Description | +| ----------------- | ---------------------------------------- | +| `path` | The path to change to. | +| `--interactive` | Use an interactive UI to input the path. | - - `--interactive`: Open the selected files with an interactive UI to choose the opening method. +### `reveal` -- yank: Yank the selected files. +Change the current directory to the parent of specified file, and hover on it. - - `--cut`: Cut the selected files. +| Options/Arguments | Description | +| ----------------- | ------------------- | +| `path` | the path to reveal. | -- paste: Paste the yanked files. +### `select` - - `--force`: Overwrite the destination file if it exists. - - `--follow`: Copy the file pointed to by a symbolic link, rather than the link itself. Only can be used during copying. +| Options/Arguments | Description | +| ----------------- | -------------------------------------------------------- | +| `--state=true` | Select the current file. | +| `--state=false` | Deselect the current file. | +| `--state=none` | Default, toggle the selection state of the current file. | -- link: Create a symbolic link to the yanked files. (This is a privileged action in Windows and must be run as an administrator.) +### `select_all` - - `--relative`: Use a relative path for the symbolic link. - - `--force`: Overwrite the destination file if it exists. +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------ | +| `--state=true` | Select all files | +| `--state=false` | Deselect all files | +| `--state=none` | Default, toggle the selection state of all files | -- remove: Move the files to the trash/recycle bin on macOS/Windows. For Linux, it will follow [The FreeDesktop.org Trash specification](https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html). +### `visual_mode` - - `--force`: Don't show the confirmation dialog, and trash/delete files directly. - - `--permanently`: Permanently delete the files. +Enter visual mode (selection mode). -- create: Create a file or directory. Ends with `/` (Unix) or `\` (Windows) for directories. +| Options/Arguments | Description | +| ----------------- | ------------------------------- | +| `--unset` | Enter visual mode (unset mode). | - - `--force`: Overwrite the destination file directly if it exists, without showing the confirmation dialog. +### `open` -- rename: Rename a file or directory. +Open the selected files. - - `--force`: Overwrite the destination file directly if it exists, without showing the confirmation dialog. +| Options/Arguments | Description | +| ----------------- | ---------------------------------------------------------------------------- | +| `--interactive` | Open the selected files with an interactive UI to choose the opening method. | -- copy: Copy the path of files or directories that are selected or hovered on. +### `yank` - - `path`: Copy the absolute path. - - `dirname`: Copy the path of the parent directory. - - `filename`: Copy the name of the file. - - `name_without_ext`: Copy the name of the file without the extension. +Yank the selected files. -- shell: Run a shell command. +| Options/Arguments | Description | +| ----------------- | ----------------------- | +| `--cut` | Cut the selected files. | - - `exec`: Optional, command template to be run. - - `--block`: Open in a blocking manner. After setting this, Yazi will hide into a secondary screen and display the program on the main screen until it exits. During this time, it can receive I/O signals, which is useful for interactive programs. - - `--confirm`: When the template is provided, run it directly, no input UI was shown. +### `paste` -- hidden: Set the visibility of hidden files. +Paste the yanked files. - - `show`: Show hidden files. - - `hide`: Hide hidden files. - - `toggle`: Default, toggle the hidden state. +| Options/Arguments | Description | +| ----------------- | ---------------------------------------------------------------------------------------------------------- | +| `--force` | Overwrite the destination file if it exists. | +| `--follow` | Copy the file pointed to by a symbolic link, rather than the link itself. Only can be used during copying. | -- linemode: Set the line mode. +### `link` - - `none`: No line mode. - - `size`: Display the size of the file. - - `permissions`: Display the permissions of the file. - - `mtime`: Display the last modified time of the file. +Create a symbolic link to the yanked files. (This is a privileged action in Windows and must be run as an administrator.) - In addition, you can also specify any 1 to 20 characters, and extend it within a UI plugin. - Which means you can implement your own linemode through the plugin by simply overriding the [`Folder:linemode` method](https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/components/folder.lua). +| Options/Arguments | Description | +| ----------------- | -------------------------------------------- | +| `--relative` | Use a relative path for the symbolic link. | +| `--force` | Overwrite the destination file if it exists. | -- search +### `remove` - - `rg`: Search files by content using ripgrep. - - `fd`: Search files by name using fd. - - `none`: Default, cancel the ongoing search. +Move the files to the trash/recycle bin on macOS/Windows. For Linux, it will follow [The FreeDesktop.org Trash specification](https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html). -- jump +| Options/Arguments | Description | +| ----------------- | -------------------------------------------------------------------- | +| `--force` | Don't show the confirmation dialog, and trash/delete files directly. | +| `--permanently` | Permanently delete the files. | - - `fzf`: Jump to a directory, or reveal a file using fzf. - - `zoxide`: Jump to a directory using zoxide. +### `create` -- find +Create a file or directory. Ends with `/` (Unix) or `\` (Windows) for directories. - - `query`: Optional, the query to find for. If not provided, an interactive UI will be used to input with. - - `--previous`: Find for the previous occurrence. - - `--smart`: Use smart-case when finding, i.e. case-sensitive if the query contains uppercase characters, otherwise case-insensitive. - - `--insensitive`: Use case-insensitive find. +| Options/Arguments | Description | +| ----------------- | ---------------------------------------------------------------------------------------------- | +| `--force` | Overwrite the destination file directly if it exists, without showing the confirmation dialog. | -- find_arrow: Move the cursor to the next or previous occurrence. +### `rename` - - `--previous`: Move to the previous occurrence. +Rename a file or directory. -- filter +| Options/Arguments | Description | +| ----------------- | ---------------------------------------------------------------------------------------------- | +| `--force` | Overwrite the destination file directly if it exists, without showing the confirmation dialog. | - - `query`: Optional, the query to filter for. If not provided, an interactive UI will be used to input with. - - `--smart`: Use smart-case when filtering, i.e. case-sensitive if the query contains uppercase characters, otherwise case-insensitive. - - `--insensitive`: Use case-insensitive filter. +### `copy` -- sort +Copy the path of files or directories that are selected or hovered on. - - `by`: Optional, if not provided, the sort method will be kept unchanged. - - `"none"`: Don't sort. - - `"modified"`: Sort by last modified time. - - `"created"`: Sort by creation time. - - `"extension"`: Sort by file extension. - - `"alphabetical"`: Sort alphabetically, e.g. `1.md` < `10.md` < `2.md` - - `"natural"`: Sort naturally, e.g. `1.md` < `2.md` < `10.md` - - `"size"`: Sort by file size. - - `--reverse`: Display files in reverse order. - - `--dir-first`: Display directories first. +| Options/Arguments | Description | +| ------------------ | ------------------------------------------------ | +| `path` | Copy the absolute path. | +| `dirname` | Copy the path of the parent directory. | +| `filename` | Copy the name of the file. | +| `name_without_ext` | Copy the name of the file without the extension. | -### Tabs +### `shell` -- tab_create +Run a shell command. - - `path`: Create a new tab using the specified path. - - `--current`: Create a new tab using the current path. +| Options/Arguments | Description | +| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `exec` | Optional, command template to be run. | +| `--block` | Open in a blocking manner. After setting this, Yazi will hide into a secondary screen and display the program on the main screen until it exits. During this time, it can receive I/O signals, which is useful for interactive programs. | +| `--confirm` | When the template is provided, run it directly, no input UI was shown. | -- tab_close +### `hidden` - - `n`: Close the tab at position n, starting from 0. +Set the visibility of hidden files. -- tab_switch +| Options/Arguments | Description | +| ----------------- | --------------------------------- | +| `show` | Show hidden files. | +| `hide` | Hide hidden files. | +| `toggle` | Default, toggle the hidden state. | - - `n`: Switch to the tab at position n, starting from 0. - - `--relative`: Switch to the tab at a position relative to the current tab. The value of n can be negative when using this parameter. +### `linemode` -- tab_swap +Set the line mode. - - `n`: Swap the current tab with the tab at position n, where negative values move the tab forward, and positive values move it backward. +| Options/Arguments | Description | +| ----------------- | ------------------------------------------- | +| `none` | No line mode. | +| `size` | Display the size of the file. | +| `permissions` | Display the permissions of the file. | +| `mtime` | Display the last modified time of the file. | -### Tasks +In addition, you can also specify any 1 to 20 characters, and extend it within a UI plugin. +Which means you can implement your own linemode through the plugin by simply overriding the [`Folder:linemode` method](https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/components/folder.lua). -- tasks_show: Show the task manager. +### `search` -### Help +| Options/Arguments | Description | +| ----------------- | -------------------------------------- | +| `rg` | Search files by content using ripgrep. | +| `fd` | Search files by name using fd. | +| `none` | Default, cancel the ongoing search. | -- help: Open the help menu. +### `jump` -## [tasks] +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------ | +| `fzf` | Jump to a directory, or reveal a file using fzf. | +| `zoxide` | Jump to a directory using zoxide. | -- close: Hide the task manager. -- arrow: - - `-1`: Move the cursor up 1 line. - - `1`: Move the cursor down 1 line. -- inspect: Inspect the task (press `q` to exit the inspect view). -- cancel: Cancel the task. -- help: Open the help menu. +### `find` -## [select] +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------ | +| `query` | Optional, the query to find for. If not provided, an interactive UI will be used to input with. | +| `--previous` | Find for the previous occurrence. | +| `--smart` | Use smart-case when finding, i.e. case-sensitive if the query contains uppercase characters, otherwise case-insensitive. | +| `--insensitive` | Use case-insensitive find. | -- close: Cancel selection. +### `find_arrow` - - `--submit`: Submit the selection. +Move the cursor to the next or previous occurrence. -- arrow +| Options/Arguments | Description | +| ----------------- | -------------------------------- | +| `--previous` | Move to the previous occurrence. | - - `n`: Move the cursor up or down n lines. Negative value for up, positive value for down. +### `filter` -- help: Open the help menu. +| Options/Arguments | Description | +| ----------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `query` | Optional, the query to filter for. If not provided, an interactive UI will be used to input with. | +| `--smart` | Use smart-case when filtering, i.e. case-sensitive if the query contains uppercase characters, otherwise case-insensitive. | +| `--insensitive` | Use case-insensitive filter. | -## [input] +### `sort` -- close: Cancel input. +- `by`: Optional, if not provided, the sort method will be kept unchanged. + - `"none"`: Don't sort. + - `"modified"`: Sort by last modified time. + - `"created"`: Sort by creation time. + - `"extension"`: Sort by file extension. + - `"alphabetical"`: Sort alphabetically, e.g. `1.md` < `10.md` < `2.md` + - `"natural"`: Sort naturally, e.g. `1.md` < `2.md` < `10.md` + - `"size"`: Sort by file size. +- `--reverse`: Display files in reverse order. +- `--dir-first`: Display directories first. - - `--submit`: Submit the input. +### `tab_create` -- escape: Go back the normal mode, or cancel input. -- move: Move the cursor left or right. +| Options/Arguments | Description | +| ----------------- | ------------------------------------------ | +| `path` | Create a new tab using the specified path. | +| `--current` | Create a new tab using the current path. | - - `n`: Move the cursor n characters left or right. Negative value for left, positive value for right. - - `--in-operating`: Move the cursor only if its currently waiting for an operation. +### `tab_close` -- backward: Move back to the start of the current or previous word. +| Options/Arguments | Description | +| ----------------- | ----------------------------------------------- | +| `[n]` | Close the tab at position `n`, starting from 0. | -- forward: Move forward to the start of the next word. - - `--end-of-word`: Move forward to the end of the current or next word. +### `tab_switch` -### Normal mode +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------ | +| `[n]` | Switch to the tab at position `n`, starting from 0. | +| `--relative` | Switch to the tab at a position relative to the current tab. The value of `n` can be negative when using this parameter. | -- insert: Enter insert mode. +### `tab_swap` - - `--append`: Insert after the cursor. +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| `[n]` | Swap the current tab with the tab at position `n`, where negative values move the tab forward, and positive values move it backward. | -- visual: Enter visual mode. +### `tasks_show` -- delete: Delete the selected characters. +Show the task manager. - - `--cut`: Cut the selected characters into clipboard, instead of only deleting them. - - `--insert`: Delete and enter insert mode. +### `help` -- yank: Copy the selected characters. -- paste: Paste the copied characters after the cursor. +Open the help menu. - - `--before`: Paste the copied characters before the cursor. +## `[tasks]` -- undo: Undo the last operation. -- redo: Redo the last operation. +### `close` -- help: Open the help menu. +Hide the task manager. -### Insert mode +### `arrow` -- backspace: Delete the character before the cursor. +| Options/Arguments | Description | +| ----------------- | ---------------------------- | +| `-1` | Move the cursor up 1 line. | +| `1` | Move the cursor down 1 line. | - - `--under`: Delete the character under the cursor. +### `inspect` -- kill: Kill the specified range of characters. +Inspect the task (press `q` to exit the inspect view). - - `bol`: Kill backwards to the BOL. - - `eol`: Kill forwards to the EOL. - - `backward`: Kill backwards to the start of the current word. - - `forward`: Kill forwards to the end of the current word. +### `cancel` -## [completion] +Cancel the task. -- close: Hide the completion menu. +### `help` - - `--submit`: Submit the completion. +Open the help menu. -- arrow +## `[select]` - - `n`: Move the cursor up or down n lines. Negative value for up, positive value for down. +### `close` -- help: Open the help menu. +Cancel selection. -## [help] +| Options/Arguments | Description | +| ----------------- | --------------------- | +| `--submit` | Submit the selection. | -- close: Hide the help menu. -- escape: Clear the filter, or hide the help menu. -- arrow - - `n`: Move the cursor up or down n lines. Negative value for up, positive value for down. -- filter: Apply a filter for the help items. +### `arrow` + +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------------------------------------------- | +| `[n]` | Move the cursor up or down `n` lines. Negative value for up, positive value for down. | + +### `help` + +Open the help menu. + +## `[input]` + +### `close` + +Cancel input. + +| Options/Arguments | Description | +| ----------------- | ----------------- | +| `--submit` | Submit the input. | + +### `escape` + +Go back the normal mode, or cancel input. + +### `move` + +Move the cursor left or right. + +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------------------------------------------------------ | +| `[n]` | Move the cursor `n` characters left or right. Negative value for left, positive value for right. | +| `--in-operating` | Move the cursor only if its currently waiting for an operation. | + +### `backward` + +Move back to the start of the current or previous word. + +### `forward` + +Move forward to the start of the next word. + +| Options/Arguments | Description | +| ----------------- | ---------------------------------------------------- | +| `--end-of-word` | Move forward to the end of the current or next word. | + +### `insert` + +Enter insert mode. + +| Options/Arguments | Description | +| ----------------- | ------------------------ | +| `--append` | Insert after the cursor. | + +### `visual` + +Enter visual mode. + +### `delete` + +Delete the selected characters. + +| Options/Arguments | Description | +| ----------------- | -------------------------------------------------------------------------- | +| `--cut` | Cut the selected characters into clipboard, instead of only deleting them. | +| `--insert` | Delete and enter insert mode. | + +### `yank` + +Copy the selected characters. + +### `paste` + +Paste the copied characters after the cursor. + +| Options/Arguments | Description | +| ----------------- | ---------------------------------------------- | +| `--before` | Paste the copied characters before the cursor. | + +### `undo` + +Undo the last operation. + +### `redo` + +Redo the last operation. + +### `help` + +Open the help menu. + +### `backspace` + +Delete the character before the cursor. + +| Options/Arguments | Description | +| ----------------- | -------------------------------------- | +| `--under` | Delete the character under the cursor. | + +### `kill` + +Kill the specified range of characters. + +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------ | +| `bol` | Kill backwards to the BOL. | +| `eol` | Kill forwards to the EOL. | +| `backward` | Kill backwards to the start of the current word. | +| `forward` | Kill forwards to the end of the current word. | + +## `[completion]` + +### `close` + +Hide the completion menu. + +| Options/Arguments | Description | +| ----------------- | ---------------------- | +| `--submit` | Submit the completion. | + +### `arrow` + +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------------------------------------------- | +| `[n]` | Move the cursor up or down `n` lines. Negative value for up, positive value for down. | + +### `help` + +Open the help menu. + +## `[help]` + +### `close` + +Hide the help menu. + +### `escape` + +Clear the filter, or hide the help menu. + +### `arrow` + +| Options/Arguments | Description | +| ----------------- | ------------------------------------------------------------------------------------- | +| `[n]` | Move the cursor up or down `n` lines. Negative value for up, positive value for down. | + +### `filter` + +Apply a filter for the help items.