Expand description
Standard complementary additions to Duat
This crate essentially consists of the standard bits that pretty
much every config crate will want to use, but aren’t strictly
speaking necessary for Duat to function. This split is mostly to
improve compile times, but semantically, if a crate doesn’t need
all of these extra things, it is nice to separate them out.
The crate has the following elements:
-
7
widgets:LineNumbersshows the numbers on aBuffer(for now), and you can configure their alignment, relativeness, etc.- The
PromptLinelets you run commands and do other things, like incremental search - The
StatusLinelets you display information that gets updated automatically, it can show information fromRwDatas, mapping functions, static elements, and every bit of Duat. It’s syntax, instatus!is the same as thetxt!macro. Notificationsshows things that have been logged to theLogsof Duat, through theerror!,warn!andinfo!macros.LogBookis a log of everything that has been notified to Duat. It is usually more admissive thanNotifications, and is most commonly scrolled by thePagerMode.Completionsis Duat’s completion widget, it provides an extensible completions list, which allows you to format the entries and add new providers via theCompletionsProvidertrait. Right now, the onlyCompletionsProvideris the words provider.WhichKeyshows what each key will do. It shows up automatically as you are typing and multi key sequences are expected (e.g. Vim’sc,d,fand others).
-
3
modes:Promptis a multitool that can serve many purposes, through thePromptModetrait, which allows one to act on thePromptLinewhile abstracting over less important elements of theWidget.Pageris a simple, read onlyMode, designed for scrolling and searching throughWidgets, most commonly theLogBook.
-
For the
PromptLine, there are 4PromptModes:RunCommandswill interpret and run Duat commands, with syntax highlighting for correctness, defined by theParametertrait.PipeSelectionswill pipe each selection on the currentBuffer, replacing them with the return value from a shell command.IncSearchis a specialized mode used for incremental search, which can abstract over what the search actually does with theIncSearchertrait.
-
For
IncSearch, there are 4IncSearchers:
Note that the IncSearcher trait can be used for many more
interesting things, like in duat-kak for example, where its
implementors allow for splitting selections, selecting everything
within a range, and many more such things in the future.
- There are also two
hooks:SearchUpdatedfor when anIncSearchis updated.SearchPerformedfor when anIncSearchis finished.
And finally, there is the state module, which contains a bunch
of StatusLine parts for you to customize the StatusLine
with.
I would consider this crate essential for all configs of Duat
out there, since it defines primitives that are not only hard to
replace, but might also be very extensible by plugins in the
ecosystem.