Enhanced editing support for Asciidoc files in Vim
vim-asciidoc provides:
: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.
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. |
g:asciidoctor_themes_dir
-
The location of your CSS stylesheets
g:asciidoctor_theme
-
The name of your preferred default theme, defaulting to the asciidoctor default red stylesheet.
-
The Epiphany browser automatically refreshes 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 (AutoReload), and
-
Chrome has the plugins (LivePage and LiveReload) to the same effect.
The key sequence <leader>1
will turn the current line into a level 1
heading using the current heading style as defined in
g: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.
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 ---------------
* item ** sub-item *** sub-sub-item
. item .. sub-item ... sub-sub-item
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.
vim-asciidoc merely bundles Stuart Rackham’s original asciidoc syntax file.
If you have the 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
vim-asciidoc provides several convenient snippets in the UltiSnips format.