Skip to content
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
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ duration-string = { version = "0.5.3", features = ["serde"] }
derive_builder = "0.20.2"
dirs = "6.0.0"
futures = "0.3.32"
promkit-widgets = { version = "0.2.0", features = ["jsonstream", "listbox", "text", "texteditor"] }
serde = "1.0.228"
termcfg = { version = "0.1.0", features = ["crossterm_0_29_0"] }
termcfg = { version = "0.2.0", features = ["crossterm_0_29_0"] }
tokio = { version = "1.49.0", features = ["full"] }
tokio-stream = "0.1.18"
toml = "0.9.8"
Expand All @@ -29,6 +28,11 @@ jaq-core = "2.2.1"
jaq-json = { version = "1.1.3", features = ["serde_json"] }
jaq-std = "2.1.2"

[dependencies.promkit-widgets]
version = "0.3.0"
features = ["jsonstream", "listbox", "serde", "text", "texteditor"]
default-features = false

# The profile that 'cargo dist' will build with
[profile.dist]
inherits = "release"
Expand Down
96 changes: 58 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,48 +208,61 @@ it will be automatically created on first run.

> [!IMPORTANT]
> The syntax in TOML configurations
> like [default.toml](./default.toml) was revamped in v0.8.0,
> like [default.toml](./default.toml) was revamped in v0.7.0,
> and the configuration shown below reflects the new format.
> A migration tool is not provided for this change.
> Please manually replace/update your local
> `config.toml` to match the new syntax.

The following settings are available in `config.toml`:
> [!WARNING]
> Depending on the type of terminal and environment,
> characters and styles may not be displayed properly.
> Specific key bindings and decorative characters may not
> display or function correctly in certain terminal emulators.

<details>
<summary>The following settings are available in config.toml</summary>

```toml
# Whether to hide hint messages
no_hint = false

# Editor settings
[editor]
# Uses promkit_widgets::text_editor::Config directly
[editor.on_focus]

# Editor mode
# "Insert": Insert characters at the cursor position
# "Overwrite": Replace characters at the cursor position with new ones
mode = "Insert"
edit_mode = "Insert"

# Characters considered as word boundaries
# These are used to define word movement and deletion behavior in the editor
word_break_chars = [".", "|", "(", ")", "[", "]"]

# How to configure colors and text attributes
#
# Color specification methods:
# 1. By name: "black", "red", etc.
# 2. By RGB value: "rgb_(255,0,0)" or "#ff0000"
# 3. By ANSI value: "ansi_(16)"
# Style notation (termcfg)
# Format: "fg=<color>,bg=<color>,ul=<color>,attr=<token|token...>"
# Examples:
# - "fg=blue"
# - "fg=#00FF00,bg=black,attr=bold|underlined"
# - "attr=dim"
#
# Text attribute specification:
# attributes = ["Bold"], etc.
# Color tokens:
# - reset, black, red, green, yellow, blue, magenta, cyan, white
# - darkgrey, darkred, darkgreen, darkyellow, darkblue, darkmagenta, darkcyan, grey
# - #RRGGBB
#
# Configuration example:
# style = { foreground = "blue", background = "magenta", attributes = ["Bold"] }
# Attribute tokens (examples):
# - bold, italic, underlined, dim, reverse, crossedout, nounderline, nobold
#
# Detailed information:
# - Color: https://docs.rs/crossterm/0.28.1/crossterm/style/enum.Color.html
# - Attribute: https://docs.rs/crossterm/0.28.1/crossterm/style/enum.Attribute.html
# Notes:
# - ANSI 256-color index tokens (0..255, e.g. "200") are currently out of notation scope.
# - See termcfg notation reference for full token list.
#
# References:
# - https://github.com/ynqa/termcfg/blob/main/Notations.md
# - https://github.com/ynqa/termcfg

# Theme settings when the editor is focused
[editor.theme_on_focus]
# Prefix shown before the cursor
prefix = "❯❯ "
# Style for the prefix
Expand All @@ -260,7 +273,7 @@ active_char_style = "bg=magenta"
inactive_char_style = ""

# Theme settings when the editor is unfocused
[editor.theme_on_defocus]
[editor.on_defocus]
# Prefix shown when focus is lost
prefix = "▼ "
# Style for the prefix when unfocused
Expand All @@ -277,8 +290,9 @@ inactive_char_style = "attr=dim"
# No limit if unset
# max_streams =

# JSON display theme
[json.theme]
# JSON display settings
# Uses promkit_widgets::jsonstream::Config directly
[json.stream]
# Number of spaces to use for indentation
indent = 2
# Style for curly brackets {}
Expand All @@ -295,18 +309,17 @@ number_value_style = ""
boolean_value_style = ""
# Style for null values
null_value_style = "fg=grey"
# Attribute for the selected row and unselected rows
active_item_attribute = "bold"
# Attribute for unselected rows
inactive_item_attribute = "dim"
# Behavior when JSON content exceeds the available width
# "Wrap": Wrap content to the next line
# "Truncate": Truncate content with an ellipsis (...)
overflow_mode = "Wrap"

# Completion feature settings
[completion]
# Number of lines to display for completion candidates
lines = 3
# Cursor character shown before the selected candidate
cursor = "❯ "
# Style for the selected candidate
active_item_style = "fg=grey,bg=yellow"
# Style for unselected candidates
inactive_item_style = "fg=grey"

# Settings for background loading of completion candidates
#
# Number of candidates loaded per chunk for search results
Expand All @@ -317,6 +330,18 @@ search_result_chunk_size = 100
# A larger value finishes loading sooner but uses more memory temporarily
search_load_chunk_size = 50000

# Completion UI settings
# Uses promkit_widgets::listbox::Config directly
[completion.listbox]
# Number of lines to display for completion candidates
lines = 3
# Cursor character shown before the selected candidate
cursor = "❯ "
# Style for the selected candidate
active_item_style = "fg=grey,bg=yellow"
# Style for unselected candidates
inactive_item_style = "fg=grey"

# Keybinding settings
[keybinds]
# Key to exit the application
Expand Down Expand Up @@ -393,13 +418,8 @@ resize_debounce_duration = "200ms"
spin_duration = "300ms"
```

For more details on configuration, please refer to [default.toml](./default.toml)

> [!WARNING]
> Depending on the type of terminal and environment,
> characters and styles may not be displayed properly.
> Specific key bindings and decorative characters may not
> display or function correctly in certain terminal emulators.
</details>

## Stargazers over time

[![Stargazers over time](https://starchart.cc/ynqa/jnv.svg?variant=adaptive)](https://starchart.cc/ynqa/jnv)
Loading
Loading