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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top