asciidoc-vim


Ⅰ. 插件描述

VIM syntax file for AsciiDoc files

Ⅱ. 基本信息

创建日期:  2007-07-18
使用用户:  28
Github星:  45
插件作者:  Dag Wieers

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

= AsciiDoc syntax highlighting in VIM
Dag Wieers <dag@wieers.com>

== Difference with upstream syntax file
While this syntax file was independently developed, it was later merged
with improved regular expressions taken from the upstream syntax file.

  • Bold is bold, Emphasize is italic
  • Document title stands out (in bold)
  • Titles are underlined
  • Better and more colors facilitate reading and editing
  • Links and email addresses are underlined
  • Admonitions look nicer

The reason why this syntax file looks better is because it does not stick
to the provided styles (that mostly maps to programming languages and
therefor is pretty limited).

== Installing the asciidoc.vim file
Put the asciidoc.vim syntax file in your home directory at
_~/.vim/syntax/asciidoc.vim_. That should be sufficient to have AsciiDoc
support in VIM.

== Auto enabling syntax highlighting
AsciiDoc files have the default +.txt+ extension and therefor are
indistinguishable from plain text files (that do not honour the AsciiDoc
rules). Therefor we cannot automatically enable syntax highlighting in VIM for
AsciiDoc files.

To enable syntax highlighting for AsciiDoc files, add the following line at
the end of your AsciiDoc files:


// vim: set syntax=asciidoc:

Or install the +asciidoc_filetype.vim+ filetype detection script in
_~/.vim/ftdetect/asciidoc_filetype.vim_.

== Testing VIM syntax files
The syntax file considers 3 different environments.

  1. Terminal
  2. Color terminal
  3. GUI

Each of these have different capabilities and therefor can have different

  1. To test each of these on a capable terminal, try:

$ TERM=vt100 vim README.txt
$ TERM=ansi vim README.txt
$ gvim README.txt

== Known shortcomings
There are a few quirks in the syntax files. Here is an overview:

Underlining titles does not work consistently??

There is no way that we can match the length of a title with the length of
the line under it. Because of that every line preceded by text could
ambigously be interpreted as either a title or the start of a block. Use
the wiki-style syntax for titles. (used by this document)

Some asciidoc syntax is not implemented??

Yes, certain newer syntax rules have not been implemented yet, as is the case
with the upstream version.

== Feedback
If you have fixes or improvements to the syntax file, please send them to:
mailto:dag@wieers.com[dag@wieers.com].

// vim: set syntax=asciidoc:

添加新评论