Question

I recently ran across a post on Jay Fields' blog, in which Jay uses emacs' font-lock mode to change the display of words into symbols.

before after

Is there any way to do this in Vim?

Était-ce utile?

La solution

Yes, Vim's conceal feature replaces matches with a single replacement character (or none at all). This is integrated into syntax highlighting, see :help :syn-conceal.

For example, the built-in Tex filetype uses this to display special sequences directly as Greek characters etc.; see :help tex-conceal. The implementation is in runtime/syntax/tex.vim in the standard vim distribution.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top