Skip to content

Conceal support for custom commands/macros #1972

@patnr

Description

@patnr

Is your feature request related to a problem? Please describe it.
#1968 discusses conceal support

Describe the solution you'd like
I would like to be able to extend the conceal support to custom commands/macros that I define. As mentioned in the other issue, suppose I have these macros

\newcommand{\mat}[1]{{\mathbf{{#1}}}}
\newcommand{\vect}[1]{{\bm{#1}}}

Then in the text I might write

$ \mat{A} \vect{x} = \vect{b}$

The advantage of this system is that I can easily change the text styles for vectors and matrices. It'd be cool if conceal could work for the \mat and \vect commands, somehow, so that they conceal as A x = b

Describe alternatives you've considered
@lervag suggested allowing for options like

let g:vimtex_syntax_custom_cmds = {
      \ 'bold': ['mat', 'vect'],
      \ 'italic': ['todo'],
      \ 'hide': ['footnote'],
      \}

That would be great. I do not think something more dynamic (that automatically picks up the macro definitions) is needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions