Skip to content

Support for more than two arguments for vimtex_syntax_custom_cmds_with_concealed_delims #3132

@keikun555

Description

@keikun555

Big fan of this plugin!

Is your feature request related to a problem? Please describe it.
I would like to conceal custom commands that have more than two arguments

\newcommand{\hoare}[3]{\ensuremath{\left\{ #1 \right\} #2 \left\{ #3 \right\}}}

In other words, I would like to conceal

$\hoare{a}{b}{c}$

to

{a}b{c}

I was looking at #2634 and g:vimtex_syntax_custom_cmds_with_concealed_delims seems to only support up to two arguments.

Describe the solution you'd like
Ideally g:vimtex_syntax_custom_cmds_with_concealed_delims can support 3 or more arguments, and have different middle conceal characters.

let g:vimtex_syntax_custom_cmds_with_concealed_delims = \[
  \ {'name': 'hoare',
  \  'nargs': 3,
  \  'mathmode': 1,
  \  'cchar_open': '{',
  \  'cchar_mid': ['}', '{'],
  \  'cchar_close': '}'},
  \]

Describe alternatives you've considered
I tried the above configuration just with cchar_mid = '|', and was able to produce {a|b}{c}.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions