abstract
| - The conceal patch by Vince Negri allows one to "conceal" parts of lines (in-line folding). One can make those parts completely invisible or replace them with shorter/alternate characters. Uses for this patch include:
* Creating vertical folds (folding visual blocks or columns). See the foldcol.vim script, which uses the conceal patch to achieve this.
* Hiding certain "distracting" characters, like ANSI escape sequences. See the AnsiEsc.vim script. (Although it seems the conceal version of the script has been replaced with one using "ignore" highlighting.)
* Hiding or altering HTML tags. For example "Text in bold" can appear as "Text in *bold*", or simply as "Text in bold". When used with color highlighting, conceal can be a very useful feature, allowing one to see the bare text in an HTML or LaTeX document without the clutter of markup. This is achieved by making/altering a vim syntax file and using the "conceal" argument to specify which keywords, regions, or patterns can be concealed or replaced with different characters. Then one sets the "conceallevel" option to turn the concealing on or off. Without the conceal patch, the only way to achieve a similar effect is to use ignore highlighting to toggle the visibility of certain markup. However, this is effectively equivalent to making the color of the markup match the background of the text editor. The markup still takes up space and can be seen when selected. The conceal patch, on the other hand, brings a whole new level of control over how Vim displays text. The conceal patch also comes with two features useful in situations beyond concealing text. The ownsyntax option allows for two or more windows of the same file to use different syntax files. This allows one to view the same document with different highlighting. The other, related feature, cursorbind, is similar to scrollbind and allows two or more windows to remain in sync as one of them scrolls (useful for diff-ing documents).
|