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) %{
|
2017-11-03 08:34:41 +01:00
|
|
|
set-option buffer filetype asciidoc
|
2016-12-06 14:46:25 +01:00
|
|
|
}
|
2012-08-08 19:38:27 +02:00
|
|
|
|
2019-04-10 05:54:19 +02:00
|
|
|
# Initialization
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
hook -group asciidoc-highlight global WinSetOption filetype=asciidoc %{
|
2019-03-13 06:24:33 +01:00
|
|
|
require-module asciidoc
|
2019-04-10 05:54:19 +02:00
|
|
|
|
|
|
|
add-highlighter window/asciidoc ref asciidoc
|
|
|
|
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/asciidoc }
|
2019-03-13 06:24:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
provide-module asciidoc %{
|
|
|
|
|
2015-05-09 22:00:50 +02:00
|
|
|
# Highlighters
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2018-06-28 13:08:58 +02:00
|
|
|
add-highlighter shared/asciidoc group
|
|
|
|
|
|
|
|
add-highlighter shared/asciidoc/ regex (\A|\n\n)[^\n]+\n={2,}\h*$ 0:title
|
|
|
|
add-highlighter shared/asciidoc/ regex (\A|\n\n)[^\n]+\n-{2,}\h*$ 0:header
|
|
|
|
add-highlighter shared/asciidoc/ regex (\A|\n\n)[^\n]+\n~{2,}\h*$ 0:header
|
|
|
|
add-highlighter shared/asciidoc/ regex (\A|\n\n)[^\n]+\n\^{2,}\h*$ 0:header
|
|
|
|
|
|
|
|
add-highlighter shared/asciidoc/ regex (\A|\n\n)=\h+[^\n]+$ 0:title
|
|
|
|
add-highlighter shared/asciidoc/ regex (\A|\n\n)={2,}\h+[^\n]+$ 0:header
|
|
|
|
|
2020-06-02 10:50:13 +02:00
|
|
|
add-highlighter shared/asciidoc/ regex ^//(?:[^\n/][^\n]*|)$ 0:comment
|
|
|
|
add-highlighter shared/asciidoc/ regex ^(/{4,}).*?\n(/{4,})$ 0:comment
|
|
|
|
|
2020-07-23 03:28:06 +02:00
|
|
|
add-highlighter shared/asciidoc/ regex ^\h*(?<bullet>[-\*])\h+[^\n]+$ 0:list bullet:bullet
|
|
|
|
add-highlighter shared/asciidoc/ regex ^\h*(?<bullet>[-\*]+)\h+[^\n]+(\n\h+[^-\*\n]*)?$ 0:list bullet:bullet
|
2018-06-28 13:08:58 +02:00
|
|
|
add-highlighter shared/asciidoc/ regex ^(-{3,})\n[^\n\h].*?\n(-{3,})$ 0:block
|
|
|
|
add-highlighter shared/asciidoc/ regex ^(={3,})\n[^\n\h].*?\n(={3,})$ 0:block
|
|
|
|
add-highlighter shared/asciidoc/ regex ^(~{3,})\n[^\n\h].*?\n(~{3,})$ 0:block
|
|
|
|
add-highlighter shared/asciidoc/ regex ^(\*{3,})\n[^\n\h].*?\n(\*{3,})$ 0:block
|
|
|
|
add-highlighter shared/asciidoc/ regex \B(?:\+[^\n]+?\+|`[^\n]+?`)\B 0:mono
|
2020-05-15 10:56:38 +02:00
|
|
|
add-highlighter shared/asciidoc/ regex \b_[^\n]+?_\b 0:+i
|
2020-07-23 03:28:06 +02:00
|
|
|
add-highlighter shared/asciidoc/ regex \s\*[^\n\*]+\*\B 0:+b
|
|
|
|
add-highlighter shared/asciidoc/ regex \h\*[^\n\*]+\*\B 0:+b
|
2018-06-28 13:08:58 +02:00
|
|
|
add-highlighter shared/asciidoc/ regex ^:[-\w]+: 0:meta
|
2015-05-09 22:00:50 +02:00
|
|
|
|
|
|
|
# Commands
|
|
|
|
# ‾‾‾‾‾‾‾‾
|
|
|
|
|
2019-03-13 06:24:33 +01:00
|
|
|
}
|