summaryrefslogtreecommitdiff
path: root/rc/base/javascript.kak
diff options
context:
space:
mode:
Diffstat (limited to 'rc/base/javascript.kak')
-rw-r--r--rc/base/javascript.kak28
1 files changed, 14 insertions, 14 deletions
diff --git a/rc/base/javascript.kak b/rc/base/javascript.kak
index 2bcffb4f..a8092707 100644
--- a/rc/base/javascript.kak
+++ b/rc/base/javascript.kak
@@ -8,7 +8,7 @@ hook global BufCreate .*[.](js) %{
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
-add-highlighter -group / regions -default code javascript \
+add-highlighter shared/ regions -default code javascript \
double_string '"' (?<!\\)(\\\\)*" '' \
single_string "'" (?<!\\)(\\\\)*' '' \
literal "`" (?<!\\)(\\\\)*` '' \
@@ -20,21 +20,21 @@ add-highlighter -group / regions -default code javascript \
# Regular expression flags are: g → global match, i → ignore case, m → multi-lines, u → unicode, y → sticky
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
-add-highlighter -group /javascript/double_string fill string
-add-highlighter -group /javascript/single_string fill string
-add-highlighter -group /javascript/regex fill meta
-add-highlighter -group /javascript/comment fill comment
-add-highlighter -group /javascript/literal fill string
-add-highlighter -group /javascript/literal regex \$\{.*?\} 0:value
+add-highlighter shared/javascript/double_string fill string
+add-highlighter shared/javascript/single_string fill string
+add-highlighter shared/javascript/regex fill meta
+add-highlighter shared/javascript/comment fill comment
+add-highlighter shared/javascript/literal fill string
+add-highlighter shared/javascript/literal regex \$\{.*?\} 0:value
-add-highlighter -group /javascript/code regex \$\w* 0:variable
-add-highlighter -group /javascript/code regex \b(document|false|null|parent|self|this|true|undefined|window)\b 0:value
-add-highlighter -group /javascript/code regex "-?[0-9]*\.?[0-9]+" 0:value
-add-highlighter -group /javascript/code regex \b(Array|Boolean|Date|Function|Number|Object|RegExp|String|Symbol)\b 0:type
+add-highlighter shared/javascript/code regex \$\w* 0:variable
+add-highlighter shared/javascript/code regex \b(document|false|null|parent|self|this|true|undefined|window)\b 0:value
+add-highlighter shared/javascript/code regex "-?[0-9]*\.?[0-9]+" 0:value
+add-highlighter shared/javascript/code regex \b(Array|Boolean|Date|Function|Number|Object|RegExp|String|Symbol)\b 0:type
# Keywords are collected at
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords
-add-highlighter -group /javascript/code regex \b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|function|if|import|in|instanceof|let|new|of|return|super|switch|throw|try|typeof|var|void|while|with|yield)\b 0:keyword
+add-highlighter shared/javascript/code regex \b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|function|if|import|in|instanceof|let|new|of|return|super|switch|throw|try|typeof|var|void|while|with|yield)\b 0:keyword
# Commands
# ‾‾‾‾‾‾‾‾
@@ -67,7 +67,7 @@ def -hidden javascript-indent-on-new-line %<
# Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
-hook -group javascript-highlight global WinSetOption filetype=javascript %{ add-highlighter ref javascript }
+hook -group javascript-highlight global WinSetOption filetype=javascript %{ add-highlighter window ref javascript }
hook global WinSetOption filetype=javascript %{
hook window InsertEnd .* -group javascript-hooks javascript-filter-around-selections
@@ -75,7 +75,7 @@ hook global WinSetOption filetype=javascript %{
hook window InsertChar \n -group javascript-indent javascript-indent-on-new-line
}
-hook -group javascript-highlight global WinSetOption filetype=(?!javascript).* %{ remove-highlighter javascript }
+hook -group javascript-highlight global WinSetOption filetype=(?!javascript).* %{ remove-highlighter window/javascript }
hook global WinSetOption filetype=(?!javascript).* %{
remove-hooks window javascript-indent