2015-05-09 23:00:50 +03:00
|
|
|
# http://asciidoc.org/
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
# Detection
|
|
|
|
# ‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2016-12-06 16:46:25 +03:00
|
|
|
hook global BufCreate .+\.(a(scii)?doc|asc) %{
|
2017-11-03 10:34:41 +03:00
|
|
|
set-option buffer filetype asciidoc
|
2016-12-06 16:46:25 +03:00
|
|
|
}
|
2012-08-08 21:38:27 +04:00
|
|
|
|
2015-05-09 23:00:50 +03:00
|
|
|
# Highlighters
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
|
2017-10-28 06:00:51 +03:00
|
|
|
add-highlighter shared/ group asciidoc
|
2012-08-08 21:38:27 +04:00
|
|
|
|
2017-10-28 06:00:51 +03:00
|
|
|
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
|
2017-11-02 04:52:18 +03:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2017-10-28 06:00:51 +03:00
|
|
|
add-highlighter shared/asciidoc regex ^\h+([-\*])\h+[^\n]*(\n\h+[^-\*]\S+[^\n]*)*$ 0:list 1:bullet
|
|
|
|
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
|
2018-03-05 03:20:56 +03:00
|
|
|
add-highlighter shared/asciidoc regex \b_[^\n]+?_\b 0:italic
|
2017-10-28 06:00:51 +03:00
|
|
|
add-highlighter shared/asciidoc regex \B\*[^\n]+?\*\B 0:bold
|
|
|
|
add-highlighter shared/asciidoc regex ^:[-\w]+: 0:meta
|
2015-05-09 23:00:50 +03:00
|
|
|
|
|
|
|
# Commands
|
|
|
|
# ‾‾‾‾‾‾‾‾
|
|
|
|
|
|
|
|
# Initialization
|
|
|
|
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
#
|
2017-10-28 06:00:51 +03:00
|
|
|
hook -group asciidoc-highlight global WinSetOption filetype=asciidoc %{ add-highlighter window ref asciidoc }
|
|
|
|
hook -group asciidoc-highlight global WinSetOption filetype=(?!asciidoc).* %{ remove-highlighter window/asciidoc }
|