ansiesc.vim


Ⅰ. 插件描述

ansi escape sequences concealed, but highlighted as specified (conceal)

Ⅱ. 基本信息

创建日期:  2004-11-24
使用用户:  11
Github星:  2
插件作者:  Andy Berdan

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'berdandy/ansiesc-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'berdandy/ansiesc-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'berdandy/ansiesc-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/berdandy/ansiesc.vim

Ⅳ. 文档说明

This is a mirror of http://www.vim.org/scripts/script.php?script_id=302

Files with ANSI escape sequences look good when dumped onto a terminal that accepts them, but have been a distracting clutter when edited via vim. The AnsiEsc.vim file, when sourced, will conceal Ansi escape sequences but will cause subsequent text to be colored as the escape sequence specifies when used with Vince Negri's conceal patch. AnsiEsc.vim v3 or later uses the conceal patch to accomplish this.

Without that conceal patch, the best that can be done is to suppress Ansi escape sequences with "Ignore" highlighting. AnsiEsc.vim v2 does that.


VIM Developer's Corner:

Vince Negri's "conceal" patch to vim6.3 and vim7.0 allows one to suppress strings within a line; ie. in-line folding! This feature is ideal for Ansi escape sequence handling. Starting with AnsiEsc's version 3 the <AnsiEsc.vim> script makes use of that new capability to display Ansi-sequence containing files. The Ansi escape sequences themselves are concealed (except for the line where the cursor is), but they have their desired colorizing effect. Note that you must have Vim7.0 with the +conceal option for the latest <AnsiEsc.vim> (v8) to work. Apply Vince Negri's patch to the Vim 7.0 source code and compile Vim for "huge" features. Once you've done that, simply source the <AnsiEsc.vim> file in when you want to see Ansi-escape sequenced text in Vim.

----------------------------------
Typical Compiling Directions:
----------------------------------

To use the AnsiEsc v2, just source it in when you wish to; your vim version needs +syntax, which is fairly common.

To use the conceal-mode AnsiEsc (those with versions >= 3), you'll need to have a Vim that has been patched with Vince Negri's concealownsyntax patch; the version will show both +syntax and +conceal.

Typical compiling directions:

    * cd ..wherever../vim70/
    * browse http://sites.google.com/site/vincenegri/ for the conceal/ownsyntax patch
    * patch -p0 < conceal-ownsyntax.diff
    * make distclean
    * configure --with-features=huge
    * make
    * make install

(also see: vimtip#1308)
(alpha/beta version available at http://mysite.verizon.net/astronaut/vim/index.html#ANSIESC)

添加新评论