Ⅰ. 插件描述
Enhanced editing support for Asciidoc files in VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'dahu/vim-asciidoc-better-than-revenge'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'dahu/vim-asciidoc-better-than-revenge'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'dahu/vim-asciidoc-better-than-revenge'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/dahu/vim-asciidoc
Ⅳ. 文档说明
== vim-asciidoc
Enhanced editing support for http://asciidoc.org[Asciidoc] files in Vim
=== Dependencies
- https://github.com/dahu/vimple[]
- https://github.com/dahu/Asif[]
- https://github.com/Raimondi/VimRegStyle[]
- (optional) https://github.com/vim-scripts/SyntaxRange[]
=== Compilers
vim-asciidoc provides:
[style="horizontal"]:compiler asciidoc :: To use the original Python Asciidoc:compiler asciidoctor :: To use the newer Ruby Asciidoctor
Each compiler provides a :Theme command for changing the style-sheet.
.Asciidoc
[style="horizontal"]g:asciidoc_themes :: The list of installed themes, defaulting to the
two themes that come with standard asciidoc, flask and _volnitsky_.
g:asciidoc_theme :: The name of your preferred default theme,
defaulting to the asciidoc default blue stylesheet.
.Asciidoctor
g:asciidoctor_themes_dir :: The location of your CSS stylesheetsg:asciidoctor_theme :: The name of your preferred default theme,
defaulting to the asciidoctor default red stylesheet.
==== Live Reload
- The https://wiki.gnome.org/Apps/Web[Epiphany browser] automatically
- when it detects that the source has been updated. This makes
for a wonderful previewer when editing asciidoc files. Just run:make and switch to Epiphany and watch it auto-refresh.
- Firefox has the plugin
(https://addons.mozilla.org/fr/firefox/addon/auto-reload[AutoReload]), and - Chrome has the plugins
(https://chrome.google.com/webstore/detail/livepage/pilnojpmdoofaelbinaeodfpjheijkbh[LivePage]
and
https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei[LiveReload])
to the same effect.
=== Headings
The key sequence <leader>1 will turn the current line into a level 1
heading using the current heading style as defined ing:asciidoc_title_style (_setext_, or the default, _atx_). Similar
mappings exist for heading levels 2-5.
The Vim section keys ([[ ]] [] ][) will move you between headings.
==== Heading Styles
By default, vim-asciidoc uses asymmetric atx style headings, like:
....
== Level 2 Heading
....
You can force symmetric atx style headings with `let
g:asciidoc_title_style_atx = "symmetric"` which will result in
headings like:
....
== Level 2 Heading ==
....
Setext style headings are also supported with `let
g:asciidoc_title_style = "setext"` which results in headings like:
....
Level 2 Heading
....
=== Lists
.Nested bullet and number lists are supported using the following syntax:
....
- item
** sub-item
* sub-sub-item
....
.And numbered lists:
....
. item
.. sub-item
... sub-sub-item
....
==== List Building Commands
Use the following visual mode list building commands:
[style="horizontal"]lu :: Create unordered listslo :: Create ordered listsl> :: Increase list depthl< :: Decrease list depth
=== Reformatting
By default, Vim does the wrong thing by reformatting Asciidoc's block
delimiters as part of the paragraph. This plugin fixes that problem,
correctly formatting blocks, lists and normal paragraphs.
Use the Q key to reformat the current _block_.
=== Syntax Highlighting
vim-asciidoc merely bundles Stuart Rackham's original asciidoc syntax
file.
If you have the
https://github.com/vim-scripts/SyntaxRange[SyntaxRange] plugin
installed, source blocks within ++[=+-]++ blocks will be highlighted
according to the named language. Currently only C, Python and VimL are
highlighted by default. Submit a PR if you want to extend this set, or just
add your own to ++~/.vim/after/syntax/asciidoc.vim++
=== Snippets
vim-asciidoc provides several convenient snippets in the
https://github.com/SirVer/ultisnips[UltiSnips] format.