Skip to content

Commit

Permalink
doc: improve docs of vimtex_syntax_custom_cmds
Browse files Browse the repository at this point in the history
refer: #1972
  • Loading branch information
lervag committed Oct 9, 2024
1 parent fcbaf66 commit f216887
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions doc/vimtex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2591,7 +2591,8 @@ OPTIONS *vimtex-options*
Default: Undefined
If this is defined, then it is used instead of `name` for matching the
`cmdname` part. It is interpreted as a regular expression with "very
magic" mode activated (see |/\v|).
magic" mode activated (see |/\v|). For example, you need to use `>`
instead of `\>` for end-of-word atom (|\>|).

mathmode ~
Default: |v:false|
Expand Down Expand Up @@ -2661,13 +2662,14 @@ OPTIONS *vimtex-options*

A couple of examples may be helpful: The first in the following list shows
how to use bolded style on a custom vector macro such as `\vct{v}`. The
second example shows how to conceal `\R` with `ℝ`. The third example shows
how one may use the `nextgroup` key, and the fourth shows how to define
a command whose argument should not be spell checked. >vim
second example shows how to conceal `\R` with `ℝ`; notice the use of `cmdre`
and the end-of-word atom `>` to ensure it does not also match e.g. `\Re`.
The third example shows how one may use the `nextgroup` key, and the fourth
shows how to define a command whose argument should not be spell checked. >vim

let g:vimtex_syntax_custom_cmds = [
\ {'name': 'vct', 'mathmode': 1, 'argstyle': 'bold'},
\ {'name': 'R', 'mathmode': 1, 'concealchar': 'ℝ'},
\ {'name': 'R', 'cmdre': 'R>', 'mathmode': 1, 'concealchar': 'ℝ'},
\ {'name': 'mathnote', 'mathmode': 1, 'nextgroup': 'texMathTextArg'},
\ {'name': 'nospell', 'argspell': 0},
\]
Expand Down

0 comments on commit f216887

Please sign in to comment.