*AnsiEsc.txt* Ansi Escape Sequence Visualization Jan 10, 2015 Author: Charles E. Campbell (remove NOSPAM from Campbell's email first) Copyright: (c) 2004-2014 by Charles E. Campbell *AnsiEsc-copyright* The VIM LICENSE applies to AnsiEsc.vim and AnsiEsc.txt (see |copyright|) except use "AnsiEsc" instead of "Vim". No warranty, express or implied. Use At-Your-Own-Risk. ============================================================================== 1. Contents *AnsiEsc* *AnsiEsc-contents* 1. Contents ...................................|AnsiEsc-contents| 2. AnsiEsc Manual ...................................|AnsiEsc| 3. AnsiEsc History ...................................|AnsiEsc-history| ============================================================================== 2. Manual *AnsiEsc-manual* CONCEAL~ The best option: for this, your vim must have +conceal. Try either > :version :echo has("conceal") < if you have vim v7.3. Your vim needs to have been compiled for "big" or "huge" and to support syntax highlighting. Vim: (v7.2 or earlier) -- ansi escape sequences themselves are Ignore'd~ Ansi escape sequences have the expected effect on subsequent text, but the ansi escape sequences themselves still take up screen columns. The sequences are displayed using "Ignore" highlighting; depending on your colorscheme, this should either make the sequences blend into your background or be visually suppressed. If the sequences aren't suppressed, you need to improve your colorscheme! *:AnsiEsc* USAGE~ :AnsiEsc -- toggles Ansi escape sequence highlighting :AnsiEsc! -- rebuilds highlighting for new/removed three or more element Ansi escape sequences. RESULT~ Ansi escape sequences become concealed or ignored (depending on whether your vim supports Negri's conceal mode), and their effect on subsequent text is emulated with Vim's syntax highlighting. Syntax highlighting for one and two element codes are hard-coded into AnsiEsc.vim. There are too many possibilities for three or more element codes; these are supported by examining the file for such sequences and only building syntax highlighting rules for such sequences as are actually present in the document. EXAMPLE~ You'll want to use :AnsiEsc to see the following properly! Color Escape Sequences  -   1   2   3   4   5   7  black black black black black black black red red red red red red red green green green green green green green yellow yellow yellow yellow yellow yellow yellow blue blue blue blue blue blue blue magenta magenta magenta magenta magenta magenta magenta cyan cyan cyan cyan cyan cyan cyan white white white white white white white Black B B B B B B B B Red R R R R R R R R Green G G G G G G G G Yellow Y Y Y Y Y Y Y Y Blue B B B B B B B B Magenta M M M M M M M M Cyan C C C C C C C C White W W W W W W W W Here's the vim logo: / \ / \ / \ / \ +----+ +----+ \ ++ ++ +- | \ /| | / / \ X | | / /O \ \| | / /+-+ +-\//-+ | |/ / | | | v | | / / | | | + +| | / | |/| |\/|| +----\ +-+ +-+ ++ \ / \ / PROBLEM WITH EMBEDDING: AnsiEsc plugin highlighting cannot be embedded in another syntax language. AnsiEsc uses the syntax highlighting engine, so it is effectively another syntax highlighting language. But, there are major differences: * It supports being turned on and off * AnsiEsc is not a syntax highlighting file, it is a plugin * AnsiEsc dynamically determines some syntax highlighting by analyzing what's needed in the current file. To do a syntax highlighting file would involve an inordinate quantity of permutations, resulting in a file that would take much time to load (about a half hour with only a partially complete set of permutations on my system). Normally to embed a syntax highlighting language in another would involve a pair of syntax highlighting commands such as: syn include @AnsiEsc syn region ... defines the region where AnsiEsc \ highlighting is to occur ... contains=@AnsiEsc placed in the other syntax file's definitions. That won't work with AnsiEc because, again, AnsiEsc is not a syntax highlighting file. ============================================================================== 3. AnsiEsc History *AnsiEsc-history* {{{1 v13 Apr 12, 2012 * (Peter Brant) a "conceal" was left on a syntax definition in a no-conceal-support if block. Fixed. Apr 17, 2012 * (Ingo Karkat) support for the "reverse" attribute May 13, 2014 * (Jason Schmidt) reported that [39m didn't work. This means revert to default foreground. Similarly, [49m didn't work (which means revert to default background). Dec 11, 2014 * Implemented implicit foreground/background Jan 10, 2015 * (Evgeny Lukianchikov) provided XUbuntu support for no-ansi-sequence (AnsiNone) v12 Jul 23, 2010 * changed conc to |'cole'| to correspond to vim 7.3's change * for menus, &go =~# used to insure correct case Aug 10, 2010 * (Rainer M Schmid) changed conceallevel setting to depend on whether the version is before vim 7.3; for 7.3, also sets concealcursor * Restores conc/cole/cocu settings when AnsiEsc is toggled off. Dec 13, 2010 * Included some additional sequences involving 0 Feb 22, 2011 * for menus, &go =~# used to insure correct case v11 Apr 20, 2010 * AnsiEsc now supports enabling/disabling via a menu * [K and [00m now supported (as grep --color=always issues them) v10 May 06, 2009 * Three or more codes in an ANSI escape sequence are supported by building custom syntax and highlighting commands. May 20, 2009 * cecutil bugfix v9 May 12, 2008 * Now in plugin + autoload format. Provides :AnsiEsc command to toggle Ansi-escape sequence processing. Jan 01, 2009 * Applies Ignore highlighting to extended Ansi escape sequences support 256-colors. Mar 18, 2009 * Includes "rapid blink" ansi escape sequences. Vim doesn't have a blinking attribute, so such text uses "standout" for vim and "undercurl" for gvim. v8 Aug 16, 2006 * Uses undercurl, and so is only available for vim 7.0 v7 Dec 14, 2004 * Works better with vim2ansi output and Vince Negri's conceal patch for vim 6.x. v2 Nov 24, 2004 * This version didn't use Vince Negri's conceal patch (used Ignore highlighting) ============================================================================== Modelines: {{{1 vim:tw=78:ts=8:ft=help:fdm=marker: