From 9ea6b88c1fa67ef417d1dc6de65bc31e6f77d300 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 1 Jul 2018 19:53:35 +1000 Subject: [PATCH] Fix remaining kak scripts to use the new highlighter syntax --- rc/base/css.kak | 31 +++---- rc/base/d.kak | 63 ++++++------- rc/base/etc.kak | 49 +++++----- rc/base/fish.kak | 6 +- rc/base/gas.kak | 32 +++---- rc/base/go.kak | 32 +++---- rc/base/ini.kak | 13 ++- rc/base/java.kak | 24 +++-- rc/base/javascript.kak | 73 +++++++-------- rc/base/json.kak | 11 +-- rc/base/julia.kak | 18 ++-- rc/base/lisp.kak | 4 +- rc/base/mail.kak | 10 +- rc/base/ocaml.kak | 14 ++- rc/base/perl.kak | 46 +++++----- rc/base/restructuredtext.kak | 173 ++++++++++------------------------- rc/base/rust.kak | 36 ++++---- rc/base/scala.kak | 33 +++---- rc/base/sql.kak | 33 ++++--- rc/base/swift.kak | 35 ++++--- rc/base/yaml.kak | 23 ++--- rc/extra/cabal.kak | 17 ++-- rc/extra/coffee.kak | 43 ++++----- rc/extra/cucumber.kak | 17 ++-- rc/extra/elixir.kak | 51 +++++------ rc/extra/elm.kak | 22 ++--- rc/extra/exherbo.kak | 90 +++++++++--------- rc/extra/haml.kak | 25 ++--- rc/extra/hbs.kak | 23 +++-- rc/extra/i3.kak | 45 ++++----- rc/extra/just.kak | 27 +++--- rc/extra/kickstart.kak | 40 ++++---- rc/extra/latex.kak | 18 ++-- rc/extra/moon.kak | 24 ++--- rc/extra/nim.kak | 28 +++--- rc/extra/php.kak | 55 ++++++----- rc/extra/pony.kak | 40 ++++---- rc/extra/pug.kak | 40 ++++---- rc/extra/ragel.kak | 22 ++--- rc/extra/scss.kak | 14 ++- rc/extra/taskpaper.kak | 14 +-- rc/extra/tupfile.kak | 26 +++--- 42 files changed, 638 insertions(+), 802 deletions(-) diff --git a/rc/base/css.kak b/rc/base/css.kak index ad1dff5d..c7669da4 100644 --- a/rc/base/css.kak +++ b/rc/base/css.kak @@ -11,29 +11,26 @@ hook global BufCreate .*[.](css) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default selector css \ - declaration [{] [}] '' \ - comment /[*] [*]/ '' +add-highlighter shared/css regions +add-highlighter shared/css/selector default-region group +add-highlighter shared/css/declaration region [{] [}] '' regions +add-highlighter shared/css/comment region /[*] [*]/ '' fill comment -add-highlighter shared/css/comment fill comment - -add-highlighter shared/css/declaration regions content \ - string '"' (? ~ -hook -group gas-highlight global WinSetOption filetype=gas %{ add-highlighter window ref gas } +hook -group gas-highlight global WinSetOption filetype=gas %{ add-highlighter window/gas ref gas } hook global WinSetOption filetype=gas %{ hook window InsertChar \n -group gas-indent gas-indent-on-new-line diff --git a/rc/base/go.kak b/rc/base/go.kak index d17b09ae..348a2da7 100644 --- a/rc/base/go.kak +++ b/rc/base/go.kak @@ -11,19 +11,15 @@ hook global BufCreate .*\.go %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code go \ - back_string '`' '`' '' \ - double_string '"' (?])(?!>\()) (|/>) (?])(?!>\()) (|/>) (? < \ - expr \{ \} \{ + add-highlighter "shared/%arg{1}/jsx/tag" region <(?=[/a-zA-Z]) (? < regions + add-highlighter "shared/%arg{1}/jsx/expr" region \{ \} \{ ref %arg{1} + - add-highlighter "shared/%arg{1}/jsx/content/expr" ref %arg{1} + add-highlighter "shared/%arg{1}/jsx/tag/base" default-region group + add-highlighter "shared/%arg{1}/jsx/tag/double_string" region =\K" (?) 0:meta - add-highlighter "shared/%arg{1}/jsx/content/tag" regex ) 0:meta - - add-highlighter "shared/%arg{1}/jsx/content/tag" regions content \ - string =\K" (?|<=|=|>=) 0:operator diff --git a/rc/base/mail.kak b/rc/base/mail.kak index 86b76193..3318a8a9 100644 --- a/rc/base/mail.kak +++ b/rc/base/mail.kak @@ -2,10 +2,10 @@ hook global BufCreate .+\.eml %{ set-option buffer filetype mail } -add-highlighter shared/ group mail -add-highlighter shared/mail regex ^(From|To|Cc|Bcc|Subject|Reply-To|In-Reply-To):([^\n]*(?:\n\h+[^\n]+)*)$ 1:keyword 2:attribute -add-highlighter shared/mail regex <[^@>]+@.*?> 0:string -add-highlighter shared/mail regex ^>.*?$ 0:comment +add-highlighter shared/mail group +add-highlighter shared/mail/ regex ^(From|To|Cc|Bcc|Subject|Reply-To|In-Reply-To):([^\n]*(?:\n\h+[^\n]+)*)$ 1:keyword 2:attribute +add-highlighter shared/mail/ regex <[^@>]+@.*?> 0:string +add-highlighter shared/mail/ regex ^>.*?$ 0:comment -hook -group mail-highlight global WinSetOption filetype=mail %{ add-highlighter window ref mail } +hook -group mail-highlight global WinSetOption filetype=mail %{ add-highlighter window/mail ref mail } hook -group mail-highlight global WinSetOption filetype=(?!mail).* %{ remove-highlighter window/mail } diff --git a/rc/base/ocaml.kak b/rc/base/ocaml.kak index 07d0569b..bdc76bc8 100644 --- a/rc/base/ocaml.kak +++ b/rc/base/ocaml.kak @@ -13,12 +13,10 @@ hook global BufCreate .*\.mli? %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code ocaml \ - string '"' (?|\$\?|\$@|\$\[|\$\\|\$\]|\$\^|\$\||\$~|%!|@\+|@-|@_} 0:value -add-highlighter shared/perl/code regex (%ENV|%INC|%OVERLOAD|%SIG|@ARGV|@INC|@LAST_MATCH_START) 0:value -add-highlighter shared/perl/code regex %{%\^(H)\b} 0:value -add-highlighter shared/perl/code regex \$\^(S|T|V|W|X|A|C|D|E|F|H|I|L|M|N|O|P|R)\b 0:value -add-highlighter shared/perl/code regex \$\^(RE_TRIE_MAXBUF|TAINT|UNICODE|UTF8LOCALE|WARNING_BITS|WIDE_SYSTEM_CALLS|CHILD_ERROR_NATIVE|ENCODING|OPEN|RE_DEBUG_FLAGS)\b 0:value +add-highlighter shared/perl/code/ regex (?!\$)-?([0-9]*\.(?!0[xXbB]))?\b([0-9]+|0[xX][0-9a-fA-F]+|0[bb][01_]+)\.?([eE][+-]?[0-9]+)?i?\b 0:value +add-highlighter shared/perl/code/ regex %{\$!|\$"|\$#|\$\$|\$%|\$&|\$'|\$\(|\$\)|\$\*|\$\+|\$,|\$_|\$-|\$`|\$\.|\$/|\$:|\$;|\$<|\$=|\$>|\$\?|\$@|\$\[|\$\\|\$\]|\$\^|\$\||\$~|%!|@\+|@-|@_} 0:value +add-highlighter shared/perl/code/ regex (%ENV|%INC|%OVERLOAD|%SIG|@ARGV|@INC|@LAST_MATCH_START) 0:value +add-highlighter shared/perl/code/ regex %{%\^(H)\b} 0:value +add-highlighter shared/perl/code/ regex \$\^(S|T|V|W|X|A|C|D|E|F|H|I|L|M|N|O|P|R)\b 0:value +add-highlighter shared/perl/code/ regex \$\^(RE_TRIE_MAXBUF|TAINT|UNICODE|UTF8LOCALE|WARNING_BITS|WIDE_SYSTEM_CALLS|CHILD_ERROR_NATIVE|ENCODING|OPEN|RE_DEBUG_FLAGS)\b 0:value -add-highlighter shared/perl/code regex \$[0-9]+ 0:attribute -add-highlighter shared/perl/code regex \b-(B|b|C|c|d|e|f|g|k|l|M|O|o|p|r|R|S|s|T|t|u|w|W|X|x|z)\b 0:attribute +add-highlighter shared/perl/code/ regex \$[0-9]+ 0:attribute +add-highlighter shared/perl/code/ regex \b-(B|b|C|c|d|e|f|g|k|l|M|O|o|p|r|R|S|s|T|t|u|w|W|X|x|z)\b 0:attribute -add-highlighter shared/perl/code regex \$[a-zA-Z_][a-zA-Z0-9_]* 0:variable +add-highlighter shared/perl/code/ regex \$[a-zA-Z_][a-zA-Z0-9_]* 0:variable -add-highlighter shared/perl/code regex \$(a|b|LAST_REGEXP_CODE_RESULT|LIST_SEPARATOR|MATCH|MULTILINE_MATCHING|NR|OFMT|OFS|ORS|OS_ERROR|OSNAME|OUTPUT_AUTO_FLUSH|OUTPUT_FIELD_SEPARATOR|OUTPUT_RECORD_SEPARATOR)\b 0:value -add-highlighter shared/perl/code regex \$(LAST_REGEXP_CODE_RESULT|LIST_SEPARATOR|MATCH|MULTILINE_MATCHING|NR|OFMT|OFS|ORS|OS_ERROR|OSNAME|OUTPUT_AUTO_FLUSH|OUTPUT_FIELD_SEPARATOR|OUTPUT_RECORD_SEPARATOR|PERL_VERSION|ACCUMULATOR|PERLDB|ARG|PID|ARGV|POSTMATCH|PREMATCH|BASETIME|PROCESS_ID|CHILD_ERROR|PROGRAM_NAME|COMPILING|REAL_GROUP_ID|DEBUGGING|REAL_USER_ID|EFFECTIVE_GROUP_ID|RS|EFFECTIVE_USER_ID|SUBSCRIPT_SEPARATOR|EGID|SUBSEP|ERRNO|SYSTEM_FD_MAX|EUID|UID|EVAL_ERROR|WARNING|EXCEPTIONS_BEING_CAUGHT|EXECUTABLE_NAME|EXTENDED_OS_ERROR|FORMAT_FORMFEED|FORMAT_LINE_BREAK_CHARACTERS|FORMAT_LINES_LEFT|FORMAT_LINES_PER_PAGE|FORMAT_NAME|FORMAT_PAGE_NUMBER|FORMAT_TOP_NAME|GID|INPLACE_EDIT|INPUT_LINE_NUMBER|INPUT_RECORD_SEPARATOR|LAST_MATCH_END|LAST_PAREN_MATCH)\b 0:value +add-highlighter shared/perl/code/ regex \$(a|b|LAST_REGEXP_CODE_RESULT|LIST_SEPARATOR|MATCH|MULTILINE_MATCHING|NR|OFMT|OFS|ORS|OS_ERROR|OSNAME|OUTPUT_AUTO_FLUSH|OUTPUT_FIELD_SEPARATOR|OUTPUT_RECORD_SEPARATOR)\b 0:value +add-highlighter shared/perl/code/ regex \$(LAST_REGEXP_CODE_RESULT|LIST_SEPARATOR|MATCH|MULTILINE_MATCHING|NR|OFMT|OFS|ORS|OS_ERROR|OSNAME|OUTPUT_AUTO_FLUSH|OUTPUT_FIELD_SEPARATOR|OUTPUT_RECORD_SEPARATOR|PERL_VERSION|ACCUMULATOR|PERLDB|ARG|PID|ARGV|POSTMATCH|PREMATCH|BASETIME|PROCESS_ID|CHILD_ERROR|PROGRAM_NAME|COMPILING|REAL_GROUP_ID|DEBUGGING|REAL_USER_ID|EFFECTIVE_GROUP_ID|RS|EFFECTIVE_USER_ID|SUBSCRIPT_SEPARATOR|EGID|SUBSEP|ERRNO|SYSTEM_FD_MAX|EUID|UID|EVAL_ERROR|WARNING|EXCEPTIONS_BEING_CAUGHT|EXECUTABLE_NAME|EXTENDED_OS_ERROR|FORMAT_FORMFEED|FORMAT_LINE_BREAK_CHARACTERS|FORMAT_LINES_LEFT|FORMAT_LINES_PER_PAGE|FORMAT_NAME|FORMAT_PAGE_NUMBER|FORMAT_TOP_NAME|GID|INPLACE_EDIT|INPUT_LINE_NUMBER|INPUT_RECORD_SEPARATOR|LAST_MATCH_END|LAST_PAREN_MATCH)\b 0:value # Commands # ‾‾‾‾‾‾‾‾ @@ -102,7 +98,7 @@ define-command -hidden perl-indent-on-closing-curly-brace %[ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group perl-highlight global WinSetOption filetype=perl %{ add-highlighter window ref perl } +hook -group perl-highlight global WinSetOption filetype=perl %{ add-highlighter window/perl ref perl } hook global WinSetOption filetype=perl %{ # cleanup trailing whitespaces when exiting insert mode diff --git a/rc/base/restructuredtext.kak b/rc/base/restructuredtext.kak index 1a899948..f1c8f494 100644 --- a/rc/base/restructuredtext.kak +++ b/rc/base/restructuredtext.kak @@ -8,140 +8,65 @@ hook global BufCreate .*[.](rst) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default content restructuredtext \ - c \.\.\h*code::\h*c\h*\n ^\S '' \ - cabal \.\.\h*code::\h*cabal\h*\n ^\S '' \ - clojure \.\.\h*code::\h*clojure\h*\n ^\S '' \ - coffee \.\.\h*code::\h*coffee\h*\n ^\S '' \ - cpp \.\.\h*code::\h*cpp\h*\n ^\S '' \ - css \.\.\h*code::\h*css\h*\n ^\S '' \ - cucumber \.\.\h*code::\h*cucumber\h*\n ^\S '' \ - d \.\.\h*code::\h*d\h*\n ^\S '' \ - diff \.\.\h*code::\h*diff\h*\n ^\S '' \ - dockerfile \.\.\h*code::\h*dockerfile\h*\n ^\S '' \ - fish \.\.\h*code::\h*fish\h*\n ^\S '' \ - gas \.\.\h*code::\h*gas\h*\n ^\S '' \ - go \.\.\h*code::\h*go\h*\n ^\S '' \ - haml \.\.\h*code::\h*haml\h*\n ^\S '' \ - haskell \.\.\h*code::\h*haskell\h*\n ^\S '' \ - html \.\.\h*code::\h*html\h*\n ^\S '' \ - ini \.\.\h*code::\h*ini\h*\n ^\S '' \ - java \.\.\h*code::\h*java\h*\n ^\S '' \ - javascript \.\.\h*code::\h*javascript\h*\n ^\S '' \ - json \.\.\h*code::\h*json\h*\n ^\S '' \ - julia \.\.\h*code::\h*julia\h*\n ^\S '' \ - kak \.\.\h*code::\h*kak\h*\n ^\S '' \ - kickstart \.\.\h*code::\h*kickstart\h*\n ^\S '' \ - latex \.\.\h*code::\h*latex\h*\n ^\S '' \ - lisp \.\.\h*code::\h*lisp\h*\n ^\S '' \ - lua \.\.\h*code::\h*lua\h*\n ^\S '' \ - makefile \.\.\h*code::\h*makefile\h*\n ^\S '' \ - moon \.\.\h*code::\h*moon\h*\n ^\S '' \ - objc \.\.\h*code::\h*objc\h*\n ^\S '' \ - perl \.\.\h*code::\h*perl\h*\n ^\S '' \ - pug \.\.\h*code::\h*pug\h*\n ^\S '' \ - python \.\.\h*code::\h*python\h*\n ^\S '' \ - ragel \.\.\h*code::\h*ragel\h*\n ^\S '' \ - ruby \.\.\h*code::\h*ruby\h*\n ^\S '' \ - rust \.\.\h*code::\h*rust\h*\n ^\S '' \ - sass \.\.\h*code::\h*sass\h*\n ^\S '' \ - scala \.\.\h*code::\h*scala\h*\n ^\S '' \ - scss \.\.\h*code::\h*scss\h*\n ^\S '' \ - sh \.\.\h*code::\h*sh\h*\n ^\S '' \ - swift \.\.\h*code::\h*swift\h*\n ^\S '' \ - tupfile \.\.\h*code::\h*tupfile\h*\n ^\S '' \ - yaml \.\.\h*code::\h*yaml\h*\n ^\S '' \ - code ::\h*\n ^[^\s] '' +add-highlighter shared/restructuredtext regions +add-highlighter shared/restructuredtext/content default-region group +add-highlighter shared/restructuredtext/code region ::\h*\n ^[^\s] '' fill meta -add-highlighter shared/restructuredtext/code fill meta - -add-highlighter shared/restructuredtext/c ref c -add-highlighter shared/restructuredtext/cabal ref cabal -add-highlighter shared/restructuredtext/clojure ref clojure -add-highlighter shared/restructuredtext/coffee ref coffee -add-highlighter shared/restructuredtext/cpp ref cpp -add-highlighter shared/restructuredtext/css ref css -add-highlighter shared/restructuredtext/cucumber ref cucumber -add-highlighter shared/restructuredtext/d ref d -add-highlighter shared/restructuredtext/diff ref diff -add-highlighter shared/restructuredtext/dockerfile ref dockerfile -add-highlighter shared/restructuredtext/fish ref fish -add-highlighter shared/restructuredtext/gas ref gas -add-highlighter shared/restructuredtext/go ref go -add-highlighter shared/restructuredtext/haml ref haml -add-highlighter shared/restructuredtext/haskell ref haskell -add-highlighter shared/restructuredtext/html ref html -add-highlighter shared/restructuredtext/ini ref ini -add-highlighter shared/restructuredtext/java ref java -add-highlighter shared/restructuredtext/javascript ref javascript -add-highlighter shared/restructuredtext/json ref json -add-highlighter shared/restructuredtext/julia ref julia -add-highlighter shared/restructuredtext/kak ref kakrc -add-highlighter shared/restructuredtext/kickstart ref kickstart -add-highlighter shared/restructuredtext/latex ref latex -add-highlighter shared/restructuredtext/lisp ref lisp -add-highlighter shared/restructuredtext/lua ref lua -add-highlighter shared/restructuredtext/makefile ref makefile -add-highlighter shared/restructuredtext/moon ref moon -add-highlighter shared/restructuredtext/objc ref objc -add-highlighter shared/restructuredtext/perl ref perl -add-highlighter shared/restructuredtext/pug ref pug -add-highlighter shared/restructuredtext/python ref python -add-highlighter shared/restructuredtext/ragel ref ragel -add-highlighter shared/restructuredtext/ruby ref ruby -add-highlighter shared/restructuredtext/rust ref rust -add-highlighter shared/restructuredtext/sass ref sass -add-highlighter shared/restructuredtext/scala ref scala -add-highlighter shared/restructuredtext/scss ref scss -add-highlighter shared/restructuredtext/sh ref sh -add-highlighter shared/restructuredtext/swift ref swift -add-highlighter shared/restructuredtext/tupfile ref tupfile -add-highlighter shared/restructuredtext/yaml ref yaml +evaluate-commands %sh{ + for ft in c cabal clojure coffee cpp css cucumber ddiff dockerfile \ + fish gas go haml haskell html ini java javascript json \ + julia kak kickstart latex lisp lua makefile moon objc \ + perl pug python ragel ruby rust sass scala scss sh swift \ + tupfile yaml; do + ref=$(if [ "$ft" = kak ]; then echo "kakrc"; else echo "$ft"; fi) + printf 'add-highlighter shared/restructuredtext/%s region %s %s "" ref %s\n' "$ft" '\.\.\h*'$ft'::\h*c\h*\n' '^\S' "$ref" + done +} # Setext-style header # Valid header characters: # # ! " $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(#{3,}\n)?[^\n]+\n(#{3,})$ 0:title -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(!{3,}\n)?[^\n]+\n(!{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)("{3,}\n)?[^\n]+\n("{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\${3,}\n)?[^\n]+\n(\${3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(%{3,}\n)?[^\n]+\n(%{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(&{3,}\n)?[^\n]+\n(&{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)('{3,}\n)?[^\n]+\n('{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\({3,}\n)?[^\n]+\n(\({3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\){3,}\n)?[^\n]+\n(\){3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\*{3,}\n)?[^\n]+\n(\*{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\+{3,}\n)?[^\n]+\n(\+{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(,{3,}\n)?[^\n]+\n(,{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(-{3,}\n)?[^\n]+\n(-{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\.{3,}\n)?[^\n]+\n(\.{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(/{3,}\n)?[^\n]+\n(/{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(:{3,}\n)?[^\n]+\n(:{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\;{3,}\n)?[^\n]+\n(\;{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(<{3,}\n)?[^\n]+\n(<{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(={3,}\n)?[^\n]+\n(={3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(>{3,}\n)?[^\n]+\n(>{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\?{3,}\n)?[^\n]+\n(\?{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(@{3,}\n)?[^\n]+\n(@{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\[{3,}\n)?[^\n]+\n(\[{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\\{3,}\n)?[^\n]+\n(\\{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\]{3,}\n)?[^\n]+\n(\]{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\^{3,}\n)?[^\n]+\n(\^{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(_{3,}\n)?[^\n]+\n(_{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(`{3,}\n)?[^\n]+\n(`{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\{{3,}\n)?[^\n]+\n(\{{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\|{3,}\n)?[^\n]+\n(\|{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(\}{3,}\n)?[^\n]+\n(\}{3,})$ 0:header -add-highlighter shared/restructuredtext/content regex (\A|\n\n)(~{3,}\n)?[^\n]+\n(~{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(#{3,}\n)?[^\n]+\n(#{3,})$ 0:title +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(!{3,}\n)?[^\n]+\n(!{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)("{3,}\n)?[^\n]+\n("{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\${3,}\n)?[^\n]+\n(\${3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(%{3,}\n)?[^\n]+\n(%{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(&{3,}\n)?[^\n]+\n(&{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)('{3,}\n)?[^\n]+\n('{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\({3,}\n)?[^\n]+\n(\({3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\){3,}\n)?[^\n]+\n(\){3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\*{3,}\n)?[^\n]+\n(\*{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\+{3,}\n)?[^\n]+\n(\+{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(,{3,}\n)?[^\n]+\n(,{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(-{3,}\n)?[^\n]+\n(-{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\.{3,}\n)?[^\n]+\n(\.{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(/{3,}\n)?[^\n]+\n(/{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(:{3,}\n)?[^\n]+\n(:{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\;{3,}\n)?[^\n]+\n(\;{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(<{3,}\n)?[^\n]+\n(<{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(={3,}\n)?[^\n]+\n(={3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(>{3,}\n)?[^\n]+\n(>{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\?{3,}\n)?[^\n]+\n(\?{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(@{3,}\n)?[^\n]+\n(@{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\[{3,}\n)?[^\n]+\n(\[{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\\{3,}\n)?[^\n]+\n(\\{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\]{3,}\n)?[^\n]+\n(\]{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\^{3,}\n)?[^\n]+\n(\^{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(_{3,}\n)?[^\n]+\n(_{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(`{3,}\n)?[^\n]+\n(`{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\{{3,}\n)?[^\n]+\n(\{{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\|{3,}\n)?[^\n]+\n(\|{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(\}{3,}\n)?[^\n]+\n(\}{3,})$ 0:header +add-highlighter shared/restructuredtext/content/ regex (\A|\n\n)(~{3,}\n)?[^\n]+\n(~{3,})$ 0:header # Inline markup -add-highlighter shared/restructuredtext/content regex [^*](\*\*([^\s*]|([^\s*][^*]*[^\s*]))\*\*)[^*] 1:bold -add-highlighter shared/restructuredtext/content regex [^*](\*([^\s*]|([^\s*][^*]*[^\s*]))\*)[^*] 1:italic -add-highlighter shared/restructuredtext/content regex [^`](``([^\s`]|([^\s`][^`]*[^\s`]))``)[^`] 1:mono +add-highlighter shared/restructuredtext/content/ regex [^*](\*\*([^\s*]|([^\s*][^*]*[^\s*]))\*\*)[^*] 1:bold +add-highlighter shared/restructuredtext/content/ regex [^*](\*([^\s*]|([^\s*][^*]*[^\s*]))\*)[^*] 1:italic +add-highlighter shared/restructuredtext/content/ regex [^`](``([^\s`]|([^\s`][^`]*[^\s`]))``)[^`] 1:mono # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # -hook -group restructuredtext-highlight global WinSetOption filetype=restructuredtext %{ add-highlighter window ref restructuredtext } +hook -group restructuredtext-highlight global WinSetOption filetype=restructuredtext %{ add-highlighter window/restructuredtext ref restructuredtext } hook -group restructuredtext-highlight global WinSetOption filetype=(?!restructuredtext).* %{ remove-highlighter window/restructuredtext } diff --git a/rc/base/rust.kak b/rc/base/rust.kak index d05d11c2..183ee5a4 100644 --- a/rc/base/rust.kak +++ b/rc/base/rust.kak @@ -11,29 +11,27 @@ hook global BufCreate .*[.](rust|rs) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code rust \ - string %{(?|<:|:>|=:=|::|&&|\|\|) 0:operator +add-highlighter shared/scala/code/ regex (?:\b|\W)(@\w+|import|package)\b 0:meta +add-highlighter shared/scala/code/ regex \b(true|false|null)\b 0:value +add-highlighter shared/scala/code/ regex \b(?:class|extends|with)\s+(\w+) 0:type +add-highlighter shared/scala/code/ regex \b([A-Z]\w*)\b 0:type +add-highlighter shared/scala/code/ regex (?:def|var|val)\s+(\w+) 0:variable +add-highlighter shared/scala/code/ regex \b(become|case|catch|class|def|do|else|extends|final|finally|for|forSome|goto|if|initialize|macro|match|new|object|onTransition|return|startWith|stay|this|super|throw|trait|try|unbecome|using|val|var|when|while|with|yield)\b 0:keyword +add-highlighter shared/scala/code/ regex \b(abstract|final|implicit|implicitly|lazy|override|private|protected|require|sealed)\b 0:attribute +add-highlighter shared/scala/code/ regex (\[|\]|=>|<:|:>|=:=|::|&&|\|\|) 0:operator # Commands # ‾‾‾‾‾‾‾‾ @@ -64,7 +61,7 @@ define-command -hidden scala-indent-on-closing-curly-brace %[ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group scala-highlight global WinSetOption filetype=scala %{ add-highlighter window ref scala } +hook -group scala-highlight global WinSetOption filetype=scala %{ add-highlighter window/scala ref scala } hook global WinSetOption filetype=scala %[ hook window ModeChange insert:.* -group scala-hooks scala-filter-around-selections diff --git a/rc/base/sql.kak b/rc/base/sql.kak index 7338c295..c2388d03 100644 --- a/rc/base/sql.kak +++ b/rc/base/sql.kak @@ -11,12 +11,13 @@ hook global BufCreate .*/?(?i)sql %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code sql \ - string '"' (?|<|>=|<=|<>|\+=|-=|\*=|/=|%=|&=|^-=|\|\*=' 0:operator -add-highlighter shared/sql/code regex \bNULL\b 0:value -add-highlighter shared/sql/code regex \b\d+(?:\.\d+)?\b 0:value -add-highlighter shared/sql/string fill string -add-highlighter shared/sql/comment fill comment +add-highlighter shared/sql/code/ regex '\+|-|\*|/|%|&|\||^|=|>|<|>=|<=|<>|\+=|-=|\*=|/=|%=|&=|^-=|\|\*=' 0:operator +add-highlighter shared/sql/code/ regex \bNULL\b 0:value +add-highlighter shared/sql/code/ regex \b\d+(?:\.\d+)?\b 0:value # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ hook -group sql-highlight global WinSetOption filetype=sql %{ - add-highlighter window ref sql + add-highlighter window/sql ref sql } hook -group sql-highlight global WinSetOption filetype=(?!sql).* %{ diff --git a/rc/base/swift.kak b/rc/base/swift.kak index 4cdaa09f..716ac35c 100644 --- a/rc/base/swift.kak +++ b/rc/base/swift.kak @@ -2,26 +2,25 @@ hook global BufCreate .*\.(swift) %{ set-option buffer filetype swift } -add-highlighter shared/ regions -default code swift \ - string %{(?]?=?)?\d+(\.\d+)+) 0:value -add-highlighter shared/cabal/code regex \b(if|else)\b 0:keyword -add-highlighter shared/cabal/code regex ^\h*([A-Za-z][A-Za-z0-9_-]*)\h*: 1:variable +add-highlighter shared/cabal/code/ regex \b(true|false)\b|(([<>]?=?)?\d+(\.\d+)+) 0:value +add-highlighter shared/cabal/code/ regex \b(if|else)\b 0:keyword +add-highlighter shared/cabal/code/ regex ^\h*([A-Za-z][A-Za-z0-9_-]*)\h*: 1:variable # Commands # ‾‾‾‾‾‾‾‾ @@ -59,7 +58,7 @@ define-command -hidden cabal-indent-on-closing-curly-brace %[ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group cabal-highlight global WinSetOption filetype=cabal %{ add-highlighter window ref cabal } +hook -group cabal-highlight global WinSetOption filetype=cabal %{ add-highlighter window/cabal ref cabal } hook global WinSetOption filetype=cabal %[ hook window ModeChange insert:.* -group cabal-hooks cabal-filter-around-selections diff --git a/rc/extra/coffee.kak b/rc/extra/coffee.kak index 0e523fa7..b028a890 100644 --- a/rc/extra/coffee.kak +++ b/rc/extra/coffee.kak @@ -11,36 +11,33 @@ hook global BufCreate .*[.](coffee) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code coffee \ - double_string '"""' '"""' '' \ - single_string "'''" "'''" '' \ - comment '###' '###' '' \ - regex '///' ///[gimy]* '' \ - double_string '"' (?|<-|<<|>>|=>) 0:builtin -add-highlighter shared/elixir/code regex \b(require|alias|use|import)\b 0:keyword -add-highlighter shared/elixir/code regex \b(__MODULE__|__DIR__|__ENV__|__CALLER__)\b 0:value -add-highlighter shared/elixir/code regex \b(def|defp|defmacro|defmacrop|defstruct|defmodule|defimpl|defprotocol|defoverridable)\b 0:keyword -add-highlighter shared/elixir/code regex \b(fn|do|end|when|case|if|else|unless|var!|for|cond|quote|unquote|receive|with|raise|reraise|try|catch)\b 0:keyword -add-highlighter shared/elixir/code regex '@[\w_]+\b' 0:attribute -add-highlighter shared/elixir/code regex '\b\d+[\d_]*\b' 0:value +add-highlighter shared/elixir/double_string/base default-region fill string +add-highlighter shared/elixir/double_string/interpolation region \Q#{ \} \{ fill builtin + +add-highlighter shared/elixir/code/ regex ':[\w_]+\b' 0:type +add-highlighter shared/elixir/code/ regex '[\w_]+:' 0:type +add-highlighter shared/elixir/code/ regex '[A-Z][\w_]+\b' 0:module +add-highlighter shared/elixir/code/ regex '(:[\w_]+)(\.)' 1:module +add-highlighter shared/elixir/code/ regex '\b_\b' 0:default +add-highlighter shared/elixir/code/ regex '\b_[\w_]+\b' 0:default +add-highlighter shared/elixir/code/ regex '~[a-zA-Z]\(.*\)' 0:string +add-highlighter shared/elixir/code/ regex \b(true|false|nil)\b 0:value +add-highlighter shared/elixir/code/ regex (->|<-|<<|>>|=>) 0:builtin +add-highlighter shared/elixir/code/ regex \b(require|alias|use|import)\b 0:keyword +add-highlighter shared/elixir/code/ regex \b(__MODULE__|__DIR__|__ENV__|__CALLER__)\b 0:value +add-highlighter shared/elixir/code/ regex \b(def|defp|defmacro|defmacrop|defstruct|defmodule|defimpl|defprotocol|defoverridable)\b 0:keyword +add-highlighter shared/elixir/code/ regex \b(fn|do|end|when|case|if|else|unless|var!|for|cond|quote|unquote|receive|with|raise|reraise|try|catch)\b 0:keyword +add-highlighter shared/elixir/code/ regex '@[\w_]+\b' 0:attribute +add-highlighter shared/elixir/code/ regex '\b\d+[\d_]*\b' 0:value # Commands # ‾‾‾‾‾‾‾‾ @@ -65,7 +64,7 @@ define-command -hidden elixir-indent-on-new-line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group elixir-highlight global WinSetOption filetype=elixir %{ add-highlighter window ref elixir } +hook -group elixir-highlight global WinSetOption filetype=elixir %{ add-highlighter window/elixir ref elixir } hook global WinSetOption filetype=elixir %{ hook window ModeChange insert:.* -group elixir-hooks elixir-filter-around-selections diff --git a/rc/extra/elm.kak b/rc/extra/elm.kak index 170bd355..c5ccbe40 100644 --- a/rc/extra/elm.kak +++ b/rc/extra/elm.kak @@ -11,18 +11,16 @@ hook global BufCreate .*[.](elm) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code elm \ - string '"' (?]+@.*?> 0:string -add-highlighter shared/glep42 regex ^>.*?$ 0:comment +add-highlighter shared/glep42 group +add-highlighter shared/glep42/ regex ^(Title|Author|Translator|Content-Type|Posted|Revision|News-Item-Format|Display-If-Installed|Display-If-Keyword|Display-If-Profile):([^\n]*(?:\n\h+[^\n]+)*)$ 1:keyword 2:attribute +add-highlighter shared/glep42/ regex <[^@>]+@.*?> 0:string +add-highlighter shared/glep42/ regex ^>.*?$ 0:comment -hook -group glep42-highlight global WinSetOption filetype=glep42 %{ add-highlighter window ref glep42 } +hook -group glep42-highlight global WinSetOption filetype=glep42 %{ add-highlighter window/glep42 ref glep42 } hook -group glep42-highlight global WinSetOption filetype=(?!glep42).* %{ remove-highlighter window/glep42 } diff --git a/rc/extra/haml.kak b/rc/extra/haml.kak index 16925fdd..5bb3cda6 100644 --- a/rc/extra/haml.kak +++ b/rc/extra/haml.kak @@ -11,24 +11,19 @@ hook global BufCreate .*[.](haml) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code haml \ - comment ^\h*/ $ '' \ - eval ^\h*%([A-Za-z][A-Za-z0-9_-]*)([#.][A-Za-z][A-Za-z0-9_-]*)?\{\K|#\{\K (?=\}) \{ \ - eval ^\h*[=-]\K (?' 0:meta +add-highlighter shared/php/code/ regex &?\$\w* 0:variable +add-highlighter shared/php/code/ regex \b(false|null|parent|self|this|true)\b 0:value +add-highlighter shared/php/code/ regex "(\b|-)[0-9]*\.?[0-9]+\b" 0:value +add-highlighter shared/php/code/ regex \b((string|int|bool)|[A-Z][a-z].*?)\b 0:type +add-highlighter shared/php/code/ regex \B/[^\n/]+/[gimy]* 0:meta +add-highlighter shared/php/code/ regex '<\?(php)?|\?>' 0:meta -add-highlighter shared/php/double_string regex (?\w+)* 0:variable -add-highlighter shared/php/double_string regex \{(?\w+)*\} 0:variable +add-highlighter shared/php/double_string/ fill string +add-highlighter shared/php/double_string/ regex (?\w+)* 0:variable +add-highlighter shared/php/double_string/ regex \{(?\w+)*\} 0:variable # Highlight doc comments -add-highlighter shared/php/doc_comment fill string -add-highlighter shared/php/doc_comment regex '`.*`' 0:module -add-highlighter shared/php/doc_comment regex '@\w+' 0:meta +add-highlighter shared/php/doc_comment/ fill string +add-highlighter shared/php/doc_comment/ regex '`.*`' 0:module +add-highlighter shared/php/doc_comment/ regex '@\w+' 0:meta # Keywords are collected at # http://php.net/manual/en/reserved.keywords.php -add-highlighter shared/php/code regex \b(__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__CLASS__|__DIR__|__FILE__|__FUNCTION__|__LINE__|__METHOD__|__NAMESPACE__|__TRAIT__)\b 0:keyword +add-highlighter shared/php/code/ regex \b(__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__CLASS__|__DIR__|__FILE__|__FUNCTION__|__LINE__|__METHOD__|__NAMESPACE__|__TRAIT__)\b 0:keyword # Highlighter for html with php tags in it, i.e. the structure of conventional php files -add-highlighter shared/ regions -default html php-file \ - php '<\?(php)?' '\?>' '' - -add-highlighter shared/php-file/php ref php -add-highlighter shared/php-file/html ref html +add-highlighter shared/php-file regions +add-highlighter shared/php-file/html default-region ref html +add-highlighter shared/php-file/php region '<\?(php)?' '\?>' '' ref php # Commands # ‾‾‾‾‾‾‾‾ @@ -79,7 +76,7 @@ define-command -hidden php-indent-on-new-line %< # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group php-highlight global WinSetOption filetype=php %{ add-highlighter window ref php-file } +hook -group php-highlight global WinSetOption filetype=php %{ add-highlighter window/php-file ref php-file } hook global WinSetOption filetype=php %{ hook window ModeChange insert:.* -group php-hooks php-filter-around-selections diff --git a/rc/extra/pony.kak b/rc/extra/pony.kak index 6e1602a5..853cdecb 100644 --- a/rc/extra/pony.kak +++ b/rc/extra/pony.kak @@ -11,16 +11,12 @@ hook global BufCreate .*[.](pony) %{ # Highlighters & Completion # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code pony \ - double_string '"""' '"""' '' \ - double_string '"' (?' 0:type - add-highlighter shared/pony/code regex '\b(${keywords})\b' 0:keyword - add-highlighter shared/pony/code regex ';' 0:keyword - add-highlighter shared/pony/code regex '^\s*|' 0:keyword - add-highlighter shared/pony/code regex '\b(${struct})\b' 0:variable - add-highlighter shared/pony/code regex '\b(${capabilities})\b(!|^)?' 1:builtin 2:builtin + add-highlighter shared/pony/code/ regex '\b(${values})\b' 0:value + add-highlighter shared/pony/code/ regex '\b(${meta})\b' 0:meta + add-highlighter shared/pony/code/ regex '\b(${func_decl})(\s+(${capabilities}))?(\s+\w+)\(' 1:type 3:builtin 4:builtin + add-highlighter shared/pony/code/ regex '\b(${func_decl})\b' 0:type + add-highlighter shared/pony/code/ regex '=>' 0:type + add-highlighter shared/pony/code/ regex '\b(${keywords})\b' 0:keyword + add-highlighter shared/pony/code/ regex ';' 0:keyword + add-highlighter shared/pony/code/ regex '^\s*|' 0:keyword + add-highlighter shared/pony/code/ regex '\b(${struct})\b' 0:variable + add-highlighter shared/pony/code/ regex '\b(${capabilities})\b(!|^)?' 1:builtin 2:builtin " # Highlight types and attributes printf %s " - add-highlighter shared/pony/code regex '@[\w_]+\b' 0:attribute + add-highlighter shared/pony/code/ regex '@[\w_]+\b' 0:attribute " } @@ -82,7 +78,7 @@ define-command -hidden pony-indent-on-new-line %{ # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group pony-highlight global WinSetOption filetype=pony %{ add-highlighter window ref pony } +hook -group pony-highlight global WinSetOption filetype=pony %{ add-highlighter window/pony ref pony } hook global WinSetOption filetype=pony %{ hook window InsertChar \n -group pony-indent pony-indent-on-new-line diff --git a/rc/extra/pug.kak b/rc/extra/pug.kak index 767c38c3..2748aa80 100644 --- a/rc/extra/pug.kak +++ b/rc/extra/pug.kak @@ -15,31 +15,27 @@ hook global BufCreate .*[.](pug|jade) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code pug \ - text ^\h*\|\s $ '' \ - text '^\h*([A-Za-z][A-Za-z0-9_-]*)?(#[A-Za-z][A-Za-z0-9_-]*)?((?:\.[A-Za-z][A-Za-z0-9_-]*)*)?(?' 0:variable -add-highlighter shared/ragel/code regex :=|=>|->|:>|:>>|<: 0:operator -add-highlighter shared/ragel/code regex \b(action|alnum|alpha|any|ascii|case|cntrl|contained|context|data|digit|empty|eof|err|error|exec|export|exports|extend|fblen|fbreak|fbuf|fc|fcall|fcurs|fentry|fexec|fgoto|fhold|first_final|fnext|fpc|fret|from|fstack|ftargs|graph|import|include|init|inwhen|lerr|lower|machine|nocs|noend|noerror|nofinal|noprefix|outwhen|postpop|prepush|print|punct|range|space|start|to|upper|when|write|xdigit|zlen)\b 0:keyword +add-highlighter shared/ragel/code/ regex \b(true|false)\b 0:value +add-highlighter shared/ragel/code/ regex '%%\{|\}%%|<\w+>' 0:variable +add-highlighter shared/ragel/code/ regex :=|=>|->|:>|:>>|<: 0:operator +add-highlighter shared/ragel/code/ regex \b(action|alnum|alpha|any|ascii|case|cntrl|contained|context|data|digit|empty|eof|err|error|exec|export|exports|extend|fblen|fbreak|fbuf|fc|fcall|fcurs|fentry|fexec|fgoto|fhold|first_final|fnext|fpc|fret|from|fstack|ftargs|graph|import|include|init|inwhen|lerr|lower|machine|nocs|noend|noerror|nofinal|noprefix|outwhen|postpop|prepush|print|punct|range|space|start|to|upper|when|write|xdigit|zlen)\b 0:keyword # Commands # ‾‾‾‾‾‾‾‾ @@ -58,7 +56,7 @@ define-command -hidden ragel-indent-on-new-line %< # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group ragel-highlight global WinSetOption filetype=ragel %{ add-highlighter window ref ragel } +hook -group ragel-highlight global WinSetOption filetype=ragel %{ add-highlighter window/ragel ref ragel } hook global WinSetOption filetype=ragel %{ hook window ModeChange insert:.* -group ragel-hooks ragel-filter-around-selections diff --git a/rc/extra/scss.kak b/rc/extra/scss.kak index 15c3ff84..906dd7be 100644 --- a/rc/extra/scss.kak +++ b/rc/extra/scss.kak @@ -13,14 +13,12 @@ hook global BufCreate .*[.](scss) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default core scss \ - comment // $ '' +add-highlighter shared/scss regions +add-highlighter shared/scss/core default-region group +add-highlighter shared/scss/comment region // $ '' fill comment -add-highlighter shared/scss/comment fill comment - -add-highlighter shared/scss/core ref css - -add-highlighter shared/scss/core regex @[A-Za-z][A-Za-z0-9_-]* 0:meta +add-highlighter shared/scss/core/ ref css +add-highlighter shared/scss/core/ regex @[A-Za-z][A-Za-z0-9_-]* 0:meta # Commands # ‾‾‾‾‾‾‾‾ @@ -32,7 +30,7 @@ define-command -hidden scss-indent-on-closing-curly-brace css-indent-on-closing- # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group scss-highlight global WinSetOption filetype=scss %{ add-highlighter window ref scss } +hook -group scss-highlight global WinSetOption filetype=scss %{ add-highlighter window/scss ref scss } hook global WinSetOption filetype=scss %[ hook window ModeChange insert:.* -group scss-hooks scss-filter-around-selections diff --git a/rc/extra/taskpaper.kak b/rc/extra/taskpaper.kak index 1a832ad1..4b3c860e 100644 --- a/rc/extra/taskpaper.kak +++ b/rc/extra/taskpaper.kak @@ -11,13 +11,13 @@ hook global BufCreate .*\.taskpaper %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ group taskpaper +add-highlighter shared/taskpaper group -add-highlighter shared/taskpaper regex ^\h*([^:\n]+):\h*\n 1:header -add-highlighter shared/taskpaper regex \h@\w+(?:\(([^)]*)\))? 0:variable 1:value -add-highlighter shared/taskpaper regex ^\h*([^-:\n]+)\n 1:+i -add-highlighter shared/taskpaper regex ^\h*-\h+[^\n]*@done[^\n]* 0:+d -add-highlighter shared/taskpaper regex (([a-z]+://\S+)|((mailto:)[\w+-]+@\S+)) 0:link +add-highlighter shared/taskpaper/ regex ^\h*([^:\n]+):\h*\n 1:header +add-highlighter shared/taskpaper/ regex \h@\w+(?:\(([^)]*)\))? 0:variable 1:value +add-highlighter shared/taskpaper/ regex ^\h*([^-:\n]+)\n 1:+i +add-highlighter shared/taskpaper/ regex ^\h*-\h+[^\n]*@done[^\n]* 0:+d +add-highlighter shared/taskpaper/ regex (([a-z]+://\S+)|((mailto:)[\w+-]+@\S+)) 0:link # Commands # ‾‾‾‾‾‾‾‾ @@ -37,7 +37,7 @@ define-command -hidden taskpaper-indent-on-new-line %{ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ hook -group taskpaper-highlight global WinSetOption filetype=taskpaper %{ - add-highlighter window ref taskpaper + add-highlighter window/taskpaper ref taskpaper hook window InsertChar \n -group taskpaper-indent taskpaper-indent-on-new-line } hook -group taskpaper-highlight global WinSetOption filetype=(?!taskpaper).* %{ diff --git a/rc/extra/tupfile.kak b/rc/extra/tupfile.kak index cbfbbcdd..3c8347db 100644 --- a/rc/extra/tupfile.kak +++ b/rc/extra/tupfile.kak @@ -11,23 +11,21 @@ hook global BufCreate .*/?Tup(file|rules)(\.\w+)?$ %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -add-highlighter shared/ regions -default code tupfile \ - string '"' (?