2015-05-09 22:00:50 +02:00
|
|
|
# http://asciidoc.org/
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
# Detection
|
|
|
|
# ‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2016-12-06 14:46:25 +01:00
|
|
|
hook global BufCreate .+\.(a(scii)?doc|asc) %{
|
|
|
|
set buffer filetype asciidoc
|
|
|
|
}
|
2012-08-08 19:38:27 +02:00
|
|
|
|
2015-05-09 22:00:50 +02:00
|
|
|
# Highlighters
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group / group asciidoc
|
2012-08-08 19:38:27 +02:00
|
|
|
|
2017-01-25 01:24:41 +01:00
|
|
|
add-highlighter -group /asciidoc regex (\A|\n\n)[^\n]+\n={2,}\h*$ 0:title
|
|
|
|
add-highlighter -group /asciidoc regex (\A|\n\n)[^\n]+\n-{2,}\h*$ 0:header
|
|
|
|
add-highlighter -group /asciidoc regex (\A|\n\n)[^\n]+\n~{2,}\h*$ 0:header
|
|
|
|
add-highlighter -group /asciidoc regex (\A|\n\n)[^\n]+\n\^{2,}\h*$ 0:header
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group /asciidoc regex ^\h+([-\*])\h+[^\n]*(\n\h+[^-\*]\S+[^\n]*)*$ 0:list 1:bullet
|
|
|
|
add-highlighter -group /asciidoc regex ^([-=~]+)\n[^\n\h].*?\n\1$ 0:block
|
2017-10-02 14:59:22 +02:00
|
|
|
add-highlighter -group /asciidoc regex \B(?:\+[^\n]+?\+|`[^\n]+?`)\B 0:mono
|
|
|
|
add-highlighter -group /asciidoc regex \B_[^\n]+?_\B 0:italic
|
|
|
|
add-highlighter -group /asciidoc regex \B\*[^\n]+?\*\B 0:bold
|
2017-01-04 01:07:45 +01:00
|
|
|
add-highlighter -group /asciidoc regex ^:[-\w]+: 0:meta
|
2015-05-09 22:00:50 +02:00
|
|
|
|
|
|
|
# Commands
|
|
|
|
# ‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
# Initialization
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
#
|
2017-01-04 01:07:45 +01:00
|
|
|
hook -group asciidoc-highlight global WinSetOption filetype=asciidoc %{ add-highlighter ref asciidoc }
|
|
|
|
hook -group asciidoc-highlight global WinSetOption filetype=(?!asciidoc).* %{ remove-highlighter asciidoc }
|