Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

List of forms

Currently, in duat, these are the forms in use:

  • default: Is applied to every text. Can be Widget dependent, like default.LineNumbers.
  • accent: This form is used when formatting error, warning, information, or debug messages. Is used mostly with the error, warn and info masks.
  • caret.main: The form to use when printing the main "caret" (each cursor has a selection, an anchor, and a caret).
  • caret.extra: Same as caret.main, but for cursors other than the main one.
  • selection.main: Color to be used on the main selection.
  • selection.extra: Color to be used on extra selections.
  • cloak: This form is supposed to be a common "get rid of all forms temporarily" form. You should use this when you want to, for example, remove all visible color from the screen, in order to highlight something. Some plugins make use of this form, like duat-hop and duat-sneak, which are recreations of some neovim plugins.
  • alias: Is used on aliases, see the map and alias chapter for more information.
  • matched_pair: Isn't technically part of duat, but it's part of a default plugin.

Some other forms are used by specific Widgets

  • LineNumbers:

    • linenum.main: The form to be used on the main line's number.
    • linenum.wrapped: The form to be used on wrapped lines.
    • linenum.wrapped.main: Same, but for the main line, inherits from linenum.wrapped by default.

    Do note that you can set the form of the remaining lines by setting default.LineNumbers. And due to form inheritance, setting linenum will set all three forms.

  • StatusLine:

    • file, file.new, file.unsaved, file.new.scratch: Are all used by file_fmt, which shows the File's name and some other info.
    • mode: Is used by mode_fmt.
    • coord and separator: Are used by main_fmt.
    • selections: Is used by selections_fmt.
    • key and key.special: Are used by cur_map_fmt.
  • Notifications:

    • notifs.target: The form for the "target" of the notification.
    • notifs.colon: The form used by the ':' that follows the target.

    Since the Notifications widget makes heavy use of masks, you can also set notifs.target.error, if you want a different target color only when error messages are sent, for example.

  • PromptLine:

    • prompt: For the prompt on the prompt line.
    • prompt.colon: For the ':' that follows it.
    • caller.info and caller.error: For the caller, if it exists or not, respectively.
    • parameter.info and parameter.error: For parameters, if they fit or not, respectively.
    • regex.literal, regex.operator.(flags|dot|repetition|alternation), regex.class.(unicode|perl|bracketed), regex.bracket.(class|group): A bunch of forms used for highlighting regex searches.
  • LogBook:

    • log_book.(error|warn|info|debug): For the types of messages.
    • log_book.colon: For the ':' that follows them.
    • log_book.target: For the "target" of the message.
    • log_book.bracket: For the (s surrounding the target.
  • VertRule:

    • rule.upper and rule.lower: The forms to use above and below the main line.

And finally, there are also all the forms used by duat-treesitter. Since the queries were taken from nvim-treesitter, the form names follow the same patters as those from neovim:

Form namePurpose
variablevarious variable names
variable.builtinbuilt-in variable names (e.g. this, self)
variable.parameterparameters of a function
variable.parameter.builtinspecial parameters (e.g. _, it)
variable.memberobject and struct fields
constantconstant identifiers
constant.builtinbuilt-in constant values
constant.macroconstants defined by the preprocessor
modulemodules or namespaces
module.builtinbuilt-in modules or namespaces
labelGOTO and other labels (e.g. label: in C), including heredoc labels
stringstring literals
string.documentationstring documenting code (e.g. Python docstrings)
string.regexpregular expressions
string.escapeescape sequences
string.specialother special strings (e.g. dates)
string.special.symbolsymbols or atoms
string.special.pathfilenames
string.special.urlURIs (e.g. hyperlinks)
charactercharacter literals
character.specialspecial characters (e.g. wildcards)
booleanboolean literals
numbernumeric literals
number.floatfloating-point number literals
typetype or class definitions and annotations
type.builtinbuilt-in types
type.definitionidentifiers in type definitions (e.g. typedef in C)
attributeattribute annotations (e.g. Python decorators, Rust lifetimes)
attribute.builtinbuiltin annotations (e.g. @property in Python)
propertythe key in key/value pairs
functionfunction definitions
function.builtinbuilt-in functions
function.callfunction calls
function.macropreprocessor macros
function.methodmethod definitions
function.method.callmethod calls
constructorconstructor calls and definitions
operatorsymbolic operators (e.g. +, *)
keywordkeywords not fitting into specific categories
keyword.coroutinekeywords related to coroutines (e.g. go in Go, async/await in Python)
keyword.functionkeywords that define a function (e.g. func in Go, def in Python)
keyword.operatoroperators that are English words (e.g. and, or)
keyword.importkeywords for including or exporting modules (e.g. import, from in Python)
keyword.typekeywords describing namespaces and composite types (e.g. struct, enum)
keyword.modifierkeywords modifying other constructs (e.g. const, static, public)
keyword.repeatkeywords related to loops (e.g. for, while)
keyword.returnkeywords like return and yield
keyword.debugkeywords related to debugging
keyword.exceptionkeywords related to exceptions (e.g. throw, catch)
keyword.conditionalkeywords related to conditionals (e.g. if, else)
keyword.conditional.ternary ternaryoperator (e.g. ?, :)
keyword.directivevarious preprocessor directives and shebangs
keyword.directive.definepreprocessor definition directives
punctuation.delimiterdelimiters (e.g. ;, ., ,)
punctuation.bracketbrackets (e.g. (), {}, [])
punctuation.specialspecial symbols (e.g. {} in string interpolation)
commentline and block comments
comment.documentationcomments documenting code
comment.errorerror-type comments (e.g. ERROR, FIXME, DEPRECATED)
comment.warningwarning-type comments (e.g. WARNING, FIX, HACK)
comment.todotodo-type comments (e.g. TODO, WIP)
comment.notenote-type comments (e.g. NOTE, INFO, XXX)
markup.strongbold text
markup.italicitalic text
markup.strikethroughstruck-through text
markup.underlineunderlined text (only for literal underline markup!)
markup.headingheadings, titles (including markers)
markup.heading.1top-level heading
markup.heading.2section heading
markup.heading.3subsection heading
markup.heading.4and so on
markup.heading.5and so forth
markup.heading.6six levels ought to be enough for anybody
markup.quoteblock quotes
markup.mathmath environments (e.g. $ ... $ in LaTeX)
markup.linktext references, footnotes, citations, etc.
markup.link.labellink, reference descriptions
markup.link.urlURL-style links
markup.rawliteral or verbatim text (e.g. inline code)
markup.raw.blockliteral or verbatim text as a stand-alone block
markup.listlist markers
markup.list.checkedchecked todo-style list markers
markup.list.uncheckedunchecked todo-style list markers
diff.plusadded text (for diff files)
diff.minusdeleted text (for diff files)
diff.deltachanged text (for diff files)
tagXML-style tag names (e.g. in XML, HTML, etc.)
tag.builtinbuiltin tag names (e.g. HTML5 tags)
tag.attributeXML-style tag attributes
tag.delimiterXML-style tag delimiters