Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve configuration section #21

Merged
merged 5 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions docs/configuration/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ sidebar_position: 2
description: Learn how to configure keyboard shortcuts with Yazi.
---

# Keymap
# keymap.toml

:::tip
If you haven't created and used your own configuration file yet, please see [Configuration](./overview.mdx).
:::note
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.

Expand Down Expand Up @@ -199,7 +199,7 @@ If you haven't created and used your own configuration file yet, please see [Con

- help: Open the help menu.

## tasks
## [tasks]

- close: Hide the task manager.
- arrow:
Expand All @@ -209,7 +209,7 @@ If you haven't created and used your own configuration file yet, please see [Con
- cancel: Cancel the task.
- help: Open the help menu.

## select
## [select]

- close: Cancel selection.

Expand All @@ -221,7 +221,7 @@ If you haven't created and used your own configuration file yet, please see [Con

- help: Open the help menu.

## input
## [input]

- close: Cancel input.

Expand Down Expand Up @@ -274,15 +274,7 @@ If you haven't created and used your own configuration file yet, please see [Con
- `backward`: Kill backwards to the start of the current word.
- `forward`: Kill forwards to the end of the current word.

## Help

- 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.

## Completion
## [completion]

- close: Hide the completion menu.

Expand All @@ -293,3 +285,11 @@ If you haven't created and used your own configuration file yet, please see [Con
- `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
- `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.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ description: Learn how to configure Yazi.

# Configuration

There are multiple configuration files. They configure core yazi behavior, keymaps, and the theme, accordingly.
There are three configuration files for Yazi:

- [`yazi.toml`](./yazi.md) - General configuration
- [`keymap.toml`](./keymap.md) - Keybinds configuration
- [`theme.toml`](./theme.md) - Color scheme configuration

You can find the default configurations at: https://github.com/sxyazi/yazi/tree/main/yazi-config/preset.

Expand All @@ -20,3 +24,7 @@ For example, to edit the keymaps, start by copying `keymap.toml` file (found [he

- Unix: `~/.config/yazi/keymap.toml`
- Windows: `C:\Users\USERNAME\AppData\Roaming\yazi\config\keymap.toml`

## Custom config directory

You can change the Yazi configuration directory by exporting the `YAZI_CONFIG_HOME` environment variable.
22 changes: 11 additions & 11 deletions docs/configuration/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sidebar_position: 3
description: Learn how to configure your Yazi theme.
---

# Theme
# theme.toml

:::tip
If you're looking for ready-made themes and don't want to create one yourself, check out [yazi-rs/themes](https://github.com/yazi-rs/themes) repo.
Expand Down Expand Up @@ -44,7 +44,7 @@ If you're looking for ready-made themes and don't want to create one yourself, c
- hidden (Boolean): Hidden
- crossed (Boolean): Crossed out

## Manager
## [manager]

- cwd (Style): CWD text style.

Expand Down Expand Up @@ -84,7 +84,7 @@ Highlighting: The built-in syntax highlighting feature

- syntect_theme (String): Theme file path. Since Yazi and `bat` use the same highlighter, so you can directly use bat's theme files, such as `~/.config/bat/themes/Catppuccino-mocha.tmTheme`.

## Status
## [status]

- separator_open (String): Opening separator symbol. e.g. `"["`.
- separator_close (String): Closing separator symbol. e.g. `"]"`.
Expand All @@ -110,20 +110,20 @@ Permissions
- permissions_x (Style): Execute permission.
- permissions_s (Style): `-` separator.

## Select
## [select]

- border (Style): Border style.
- active (Style): Selected item style.
- inactive (Style): Unselected item style.

## Input
## [input]

- border (Style): Border style.
- title (Style): Title style.
- value (Style): Value style.
- selected (Style): Selected value style.

## Completion
## [completion]

- border (Style): Border style.
- active (Style): Selected item style.
Expand All @@ -135,13 +135,13 @@ Icons
- icon_folder (String): Folder icon.
- icon_command (String): Command icon.

## Tasks
## [tasks]

- border (Style): Border style.
- title (Style): Title style.
- hovered (Style): Hovered item style.

## Which
## [which]

- mask (Style): Mask style.
- cand (Style): Candidate key style.
Expand All @@ -150,15 +150,15 @@ Icons
- separator (String): Separator symbol. e.g. `" -> "`.
- separator_style (Style): Separator style.

## Help
## [help]

- on (Style): Key column style.
- exec (Style): Command column style.
- desc (Style): Description column style.
- hovered (Style): Hovered item style.
- footer (Style): Footer style.

## Filetype
## [filetype]

Set file list item display styles for specific file types, supporting matching by name and mime-type:

Expand All @@ -185,7 +185,7 @@ Each rule supports complete [Style properties](#Types). There are two special ru
- `name = "*"` matches all files.
- `name = "*/"` matches all directories.

## Icons
## [icons]

Display different icons based on file name rules, noting that the `/` after the name signifies that it must be a directory.

Expand Down
20 changes: 10 additions & 10 deletions docs/configuration/yazi.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ sidebar_position: 1
description: Learn how to configure Yazi's basic functionality.
---

# Yazi
# yazi.toml

:::tip
If you haven't created and used your own configuration file yet, please see [Configuration](./overview.mdx).
:::note
If you haven't created and used your own configuration file yet, please see [Configuration](./overview.md).
:::

## manager
## [manager]

- layout: Manager layout by ratio, 3-element array

Expand Down Expand Up @@ -59,7 +59,7 @@ If you haven't created and used your own configuration file yet, please see [Con
- `true`: Show
- `false`: Do not show

## preview
## [preview]

- tab_size: Tab width
- max_width: Maximum preview width for images. Do a `yazi --clear-cache` to take effect after changing this.
Expand All @@ -75,7 +75,7 @@ This is useful for solving [the bug of Ueberzug image size calculation](https://

If your monitor has a `2.0` scale factor, and is running on Wayland under Hyprland, you may need to set `ueberzug_scale: 0.5`, and adjust the value of `ueberzug_offset` according to your case, to offset this issue.

## opener
## [opener]

Configure available openers, for example:

Expand Down Expand Up @@ -105,7 +105,7 @@ Available parameters are as follows:
- `linux`: Linux
- `macos`: macOS

## open
## [open]
uncenter marked this conversation as resolved.
Show resolved Hide resolved

Set rules for opening specific files, for example:

Expand All @@ -129,7 +129,7 @@ Available rule parameters are as follows:
- mime (String): Glob expression for matching the MIME type. Case insensitive by default, add `\s` to the beginning to make it sensitive.
- use (String): Opener name corresponding to the names in the [`[opener]` section](#opener).

## tasks
## [tasks]

- micro_workers: Maximum number of concurrent micro-tasks
- macro_workers: Maximum number of concurrent macro-tasks
Expand All @@ -141,7 +141,7 @@ Available rule parameters are as follows:
- image_alloc: Maximum memory allocation limit (in bytes) for decoding a single image, `0` for unlimited.
- image_bound(`[width, height]`): Maximum image size (in pixels) for decoding a single image, `0` for unlimited.

## input
## [input]

You can customize the title and position of each `Input`. As for position, it consists of two parts: [Origin](#origin) and [Offset](#offset).

Expand Down Expand Up @@ -188,6 +188,6 @@ Some `Input`s have special placeholders that will be replaced with actual conten
- `{n}`: Number of tasks are running
- `{s}`: `"s"` if `n > 1`, otherwise `""`

## select
## [select]

Same as [the input](#input).