Skip to content

Commit ac742b6

Browse files
committed
docs: update new syntax for configurations
1 parent c55ac10 commit ac742b6

1 file changed

Lines changed: 148 additions & 45 deletions

File tree

README.md

Lines changed: 148 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -206,87 +206,190 @@ it will be automatically created on first run.
206206
207207
### Configuration Options
208208
209+
> [!IMPORTANT]
210+
> The syntax in TOML configurations
211+
> like [default.toml](./default.toml) was revamped in v0.8.0,
212+
> and the configuration shown below reflects the new format.
213+
> A migration tool is not provided for this change.
214+
> Please manually replace/update your local
215+
> `config.toml` to match the new syntax.
216+
209217
The following settings are available in `config.toml`:
210218
211219
```toml
212-
# Whether to hide the hint message
220+
# Whether to hide hint messages
213221
no_hint = false
214222

215223
# Editor settings
216224
[editor]
217-
# Editor mode ("Insert" or "Overwrite")
225+
# Editor mode
226+
# "Insert": Insert characters at the cursor position
227+
# "Overwrite": Replace characters at the cursor position with new ones
218228
mode = "Insert"
219-
# Word break characters
229+
230+
# Characters considered as word boundaries
231+
# These are used to define word movement and deletion behavior in the editor
220232
word_break_chars = [".", "|", "(", ")", "[", "]"]
221233

222-
# Theme when editor is focused
234+
# How to configure colors and text attributes
235+
#
236+
# Color specification methods:
237+
# 1. By name: "black", "red", etc.
238+
# 2. By RGB value: "rgb_(255,0,0)" or "#ff0000"
239+
# 3. By ANSI value: "ansi_(16)"
240+
#
241+
# Text attribute specification:
242+
# attributes = ["Bold"], etc.
243+
#
244+
# Configuration example:
245+
# style = { foreground = "blue", background = "magenta", attributes = ["Bold"] }
246+
#
247+
# Detailed information:
248+
# - Color: https://docs.rs/crossterm/0.28.1/crossterm/style/enum.Color.html
249+
# - Attribute: https://docs.rs/crossterm/0.28.1/crossterm/style/enum.Attribute.html
250+
251+
# Theme settings when the editor is focused
223252
[editor.theme_on_focus]
253+
# Prefix shown before the cursor
224254
prefix = "❯❯ "
225-
prefix_style = { foreground = "blue" }
226-
active_char_style = { background = "magenta" }
227-
inactive_char_style = {}
228-
229-
# Theme when editor is not focused
255+
# Style for the prefix
256+
prefix_style = "fg=blue"
257+
# Style for the character under the cursor
258+
active_char_style = "bg=magenta"
259+
# Style for all other characters
260+
inactive_char_style = ""
261+
262+
# Theme settings when the editor is unfocused
230263
[editor.theme_on_defocus]
264+
# Prefix shown when focus is lost
231265
prefix = ""
232-
prefix_style = { foreground = "blue", attributes = ["Dim"] }
233-
active_char_style = { attributes = ["Dim"] }
234-
inactive_char_style = { attributes = ["Dim"] }
266+
# Style for the prefix when unfocused
267+
prefix_style = "fg=blue,attr=dim"
268+
# Style for the character under the cursor when unfocused
269+
active_char_style = "attr=dim"
270+
# Style for all other characters when unfocused
271+
inactive_char_style = "attr=dim"
235272

236273
# JSON display settings
237274
[json]
238-
# Maximum number of JSON objects to read from stream
239-
# max_streams =
275+
# Maximum number of JSON objects to read from streams (e.g., JSON Lines format)
276+
# Limits how many objects are processed to reduce memory usage when handling large data streams
277+
# No limit if unset
278+
# max_streams =
240279

241-
# JSON theme settings
280+
# JSON display theme
242281
[json.theme]
282+
# Number of spaces to use for indentation
243283
indent = 2
244-
curly_brackets_style = { attributes = ["Bold"] }
245-
square_brackets_style = { attributes = ["Bold"] }
246-
key_style = { foreground = "cyan" }
247-
string_value_style = { foreground = "green" }
248-
number_value_style = {}
249-
boolean_value_style = {}
250-
null_value_style = { foreground = "grey" }
284+
# Style for curly brackets {}
285+
curly_brackets_style = "attr=bold"
286+
# Style for square brackets []
287+
square_brackets_style = "attr=bold"
288+
# Style for JSON keys
289+
key_style = "fg=cyan"
290+
# Style for string values
291+
string_value_style = "fg=green"
292+
# Style for number values
293+
number_value_style = ""
294+
# Style for boolean values
295+
boolean_value_style = ""
296+
# Style for null values
297+
null_value_style = "fg=grey"
251298

252299
# Completion feature settings
253300
[completion]
301+
# Number of lines to display for completion candidates
254302
lines = 3
303+
# Cursor character shown before the selected candidate
255304
cursor = ""
256-
active_item_style = { foreground = "grey", background = "yellow" }
257-
inactive_item_style = { foreground = "grey" }
305+
# Style for the selected candidate
306+
active_item_style = "fg=grey,bg=yellow"
307+
# Style for unselected candidates
308+
inactive_item_style = "fg=grey"
309+
310+
# Settings for background loading of completion candidates
311+
#
312+
# Number of candidates loaded per chunk for search results
313+
# A larger value displays results faster but uses more memory
258314
search_result_chunk_size = 100
315+
316+
# Number of items loaded per batch during background loading
317+
# A larger value finishes loading sooner but uses more memory temporarily
259318
search_load_chunk_size = 50000
260319

261-
# Keybind settings
320+
# Keybinding settings
262321
[keybinds]
263-
# Application exit key
264-
exit = [{ Key = { modifiers = "CONTROL", code = { Char = "c" } } }]
265-
# Copy query to clipboard key
266-
copy_query = [{ Key = { modifiers = "CONTROL", code = { Char = "q" } } }]
267-
# Copy result to clipboard key
268-
copy_result = [{ Key = { modifiers = "CONTROL", code = { Char = "o" } } }]
269-
# Mode switch keys
270-
switch_mode = [
271-
{ Key = { code = "Down", modifiers = "SHIFT" } },
272-
{ Key = { code = "Up", modifiers = "SHIFT" } }
273-
]
274-
275-
# Editor operation keybinds
322+
# Key to exit the application
323+
exit = ["Ctrl+C"]
324+
# Key to copy the query to the clipboard
325+
copy_query = ["Ctrl+Q"]
326+
# Key to copy the result to the clipboard
327+
copy_result = ["Ctrl+O"]
328+
# Keys to switch focus between editor and JSON viewer
329+
switch_mode = ["Shift+Down", "Shift+Up"]
330+
331+
# Keybindings for editor operations
276332
[keybinds.on_editor]
277-
# (Details omitted)
278-
279-
# JSON viewer keybinds
333+
# Move cursor left
334+
backward = ["Left"]
335+
336+
# Move cursor right
337+
forward = ["Right"]
338+
339+
# Move cursor to beginning of line
340+
move_to_head = ["Ctrl+A"]
341+
# Move cursor to end of line
342+
move_to_tail = ["Ctrl+E"]
343+
# Move cursor to previous word boundary
344+
move_to_previous_nearest = ["Alt+B"]
345+
# Move cursor to next word boundary
346+
move_to_next_nearest = ["Alt+F"]
347+
# Delete character at the cursor
348+
erase = ["Backspace"]
349+
350+
# Delete all input
351+
erase_all = ["Ctrl+U"]
352+
353+
# Delete from cursor to previous word boundary
354+
erase_to_previous_nearest = ["Ctrl+W"]
355+
# Delete from cursor to next word boundary
356+
erase_to_next_nearest = ["Alt+D"]
357+
# Trigger completion
358+
completion = ["Tab"]
359+
# Move up in the completion list
360+
on_completion.up = ["Up"]
361+
# Move down in the completion list
362+
on_completion.down = ["Down", "Tab"]
363+
364+
# Keybindings for JSON viewer operations
280365
[keybinds.on_json_viewer]
281-
# (Details omitted)
366+
# Move up in JSON viewer
367+
up = ["Up", "Ctrl+K"]
368+
# Move down in JSON viewer
369+
down = ["Down", "Ctrl+J"]
370+
# Move to the top of JSON viewer
371+
move_to_head = ["Ctrl+L"]
372+
# Move to the bottom of JSON viewer
373+
move_to_tail = ["Ctrl+H"]
374+
# Toggle expand/collapse of JSON nodes
375+
toggle = ["Enter"]
376+
# Expand all JSON nodes
377+
expand = ["Ctrl+P"]
378+
# Collapse all JSON nodes
379+
collapse = ["Ctrl+N"]
282380

283381
# Application reactivity settings
284382
[reactivity_control]
285-
# Delay time after query input
383+
# Delay before processing query input
384+
# Prevents excessive updates while user is typing
286385
query_debounce_duration = "600ms"
287-
# Redraw delay time after window resize
386+
387+
# Delay before redrawing after window resize
388+
# Prevents frequent redraws during continuous resizing
288389
resize_debounce_duration = "200ms"
289-
# Spinner animation update interval
390+
391+
# Interval for spinner animation updates
392+
# Controls the speed of the loading spinner
290393
spin_duration = "300ms"
291394
```
292395

0 commit comments

Comments
 (0)