GithubHelp home page GithubHelp logo

vim-asciidoc's Introduction

vim-asciidoc

Enhanced editing support for Asciidoc files in Vim

Compilers

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.

Asciidoc
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 stylesheets

g:asciidoctor_theme

The name of your preferred default theme, defaulting to the asciidoctor default red stylesheet.

Live Reload

  • 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.

Headings

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.

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:

lu

Create unordered lists

lo

Create ordered lists

l>

Increase list depth

l<

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 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 UltiSnips format.

vim-asciidoc's People

Contributors

dahu avatar konfekt avatar mellery451 avatar simon-nicholls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vim-asciidoc's Issues

When I open an asciidoc-file I get lots of errors

I installed vim-asciidoc via NeoBundle and when I open now a file everything I need seems to work but when opening a file a lot of errors are printed out:

Error detected while processing /home/user/dotfiles/vim/.vim/bundle/vim-asciidoc/ftplugin/asciidoc.vim:
line   96:
E121: Undefined variable: ERex
E15: Invalid expression: ERex.parse(' \%(\_^\|\n\)       # explicitly_numbered   \s*   \d\+   \.   \s\+ \| \%(\_^\|\n\)       # explicitly_alpha   \s*   [a-zA-Z]   \.   \s\
+ \| \%(\_^\|\n\)       # explicitly_roman   \s*   [ivxIVX]\+       # (must_end_in_")"   )   \s\+ \| \%(\_^\|\n\)       # definition_list   \%(\_^\|\n\)   \%(\S\+\s\+\)\+  
 ::\+   \s\+   \%(\S\+\)\@= \| \%(\_^\|\n\)       # implicit   \s*   [-*+.]\+   \s\+   \%(\S\+\)\@=')
line  102:
E716: Key not present in Dictionary: list_pattern . '/'
E15: Invalid expression: 'syn match asciidocListBullet /' . s:asciidoc.list_pattern . '/'
line  103:
E716: Key not present in Dictionary: list_pattern
E15: Invalid expression: s:asciidoc.list_pattern
line   96:
E121: Undefined variable: ERex
E15: Invalid expression: ERex.parse(' \%(\_^\|\n\)       # explicitly_numbered   \s*   \d\+   \.   \s\+ \| \%(\_^\|\n\)       # explicitly_alpha   \s*   [a-zA-Z]   \.   \s\
+ \| \%(\_^\|\n\)       # explicitly_roman   \s*   [ivxIVX]\+       # (must_end_in_")"   )   \s\+ \| \%(\_^\|\n\)       # definition_list   \%(\_^\|\n\)   \%(\S\+\s\+\)\+  
 ::\+   \s\+   \%(\S\+\)\@= \| \%(\_^\|\n\)       # implicit   \s*   [-*+.]\+   \s\+   \%(\S\+\)\@=')
line  102:
E716: Key not present in Dictionary: list_pattern . '/'
E15: Invalid expression: 'syn match asciidocListBullet /' . s:asciidoc.list_pattern . '/'
line  103:
E716: Key not present in Dictionary: list_pattern
E15: Invalid expression: s:asciidoc.list_pattern

I am using vim 8.0.3 on Ubuntu 16.04..1

Error detected while processing function vimple#version#new

vimple: commit b6cef6ef16bcd4e5bd0e07eeb102704ed1f2a47d
vim-asciidoc: commit 3dfab09
neovim: v0.3.1

Vimple appears to be causing more problems. I'm getting this on start-up:

Error detected while processing function vimple#version#new[75]..55:
line    4:
E688: More targets than List items

Is there any way to remove the dependency on vimple?

compiler parameters should be configurable

Hi, thanks for the plugin.

By default, the asciidoctor executable will use text for admonition and callout icons. If you define -a icons=font or use :icons: font in your document, asciidoctor will use foundation icons without any need to define an icons directory.

Your current compiler configuration is setting different attributes that users might not want to set, for example the icons attribute, so I can't get font or text icons to work.

I would prefer if instead of the asciidoctor_theme variable, you could set a asciidoctor_arguments variable and send that before the filename. In that way I can set everything I want.

WDYT?

Visual mode lu to make a list binding loses *bold*

In visual mode, pressing lu to turn selected lines to a list, lines starting with *bold* text lose the leading * when they are converted to list items.

*foo* stuff
*bar* stuff

is turned into

* foo* stuff
* bar* stuff

User selected spelling language

Hi. I've been using your addon and find it very useful. What would make it better is to let the user set the spelling language (currently set to en_au in ftplugin/asciidoc.vim)

Neovim support

Hey, neovim support would be awesome.

Error I get is something like:

Error detected while processing /home/myself/.vim/plugged/vim-asciidoc/ftplugin/asciidoc.vim:
line   96:
E121: Undefined variable: ERex
E15: Invalid expression: ERex.parse(' \%(\_^\|\n\)       # explicitly_numbered   \s*   \d\+   \.   \s\+ \| \%(\_^\|\n\)       # explicitly_alpha   \s*   [a-zA-Z]   \.   \
s\+ \| \%(\_^\|\n\)       # explicitly_roman   \s*   [ivxIVX]\+       # (must_end_in_")"   )   \s\+ \| \%(\_^\|\n\)       # definition_list   \%(\_^\|\n\)   \%(\S\+\s\+\)
\+   ::\+   \s\+   \%(\S\+\)\@= \| \%(\_^\|\n\)       # implicit   \s*   [-*+.]\+   \s\+   \%(\S\+\)\@=')
line  102:
E716: Key not present in Dictionary: list_pattern . '/'
E15: Invalid expression: 'syn match asciidocListBullet /' . s:asciidoc.list_pattern . '/'
line  103:
E716: Key not present in Dictionary: list_pattern
E15: Invalid expression: s:asciidoc.list_pattern

Thanks for consideration!

No newline is added when `textwidth` is reached

When writing a paragraph, vim normally insert a newline when I reach the textwidth limit, but that does not seem to work with this plug in.

Did I miss a configuration setting, and/or is this intended behavioural?

compiler asciidoc does not work on Windows

Hi Dahu,

I am using Vim-asciidoc with GVim on Windows 7. I cannot compile using the

:compiler asciidoc (or asciidoctor)

It gives the following error.

E666: compiler not supported: asciidoc

Can you please help? Syntax highlighting is working fine.

Folding ?

Is there any way to enable folding ?

Format not working with utf-8 text

Hello,

Please consider this piece of text:
Și cum spuneam, stăteam toată ziua în pătul și citeam. Luam cărți de la verișorii mei. Avea destule așa că aveam ce citi pe tot timpul vacanței de vară, care ținea 3 luni pe atunci.

I place the cursor on the starting Ș and press Q. Instead of formatting the text, vim-asciidoc display this error:

vim-asciidoc: unknown block on 77: don't know how to format: Și cum spuneam, st...

Any ideau about this error?

Can we reduce the effects of vimple?

Adding support for ASCIIdoc requires the vimple plugin according to the README. vimple, in turn, adds several mappings to all filetypes that I don't want. Perhaps the library parts of vimple could be extracted to its own plugin and then this plugin is used instead?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.