vimcat


Ⅰ. 插件描述

cat with Vim's syntax highlighting

Ⅱ. 基本信息

创建日期:  2012-08-17
使用用户:  1
Github星:  54
插件作者:  Olivier Favre

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'ofavre/vimcat-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'ofavre/vimcat-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'ofavre/vimcat-you-belong-with-me'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

  1. vimcat

A supercat with Vim powers!

  1. Installing

Simply issue the following:

sudo make install

To uninstall, issue the following:

sudo make uninstall

Alternatively you can use the Debian packages published in the "releases section":https://github.com/ofavre/vimcat/releases.

  1. How does it work?

Uses a headless Vim and runs a convertion VimScript to translate the syntax highlighting into ANSI color codes, and print the file to the console to get colorized output.
This software consists solely of VimScript and bash.

The translation program is a Vim Script inspired by the @2html@ plugin (see @:help :TOhtml@).

  1. Options

This program has many options, but you would normally use a few, if any. Use @--help@ for more information.
A few options permits you to issue arbitrary Vim commands.

  1. Performance

Inspecting the syntax highlighting with @synID()@ does not offer very good performance.
Moreover the script needs to iterates over each and every character of the file, to finds any change in coloring, and produces the corresponding color codes if any change is detected.
In 256 color modes, the parameterized strings used to output the correct color escape codes are a bit time consuming too.

  1. TODO

If performance requires:

  • Rewrite a native vim syntax file handler.

添加新评论