diff options
| author | Alex Leferry 2 <alexherbo2@gmail.com> | 2017-01-04 01:07:45 +0100 |
|---|---|---|
| committer | Alex Leferry 2 <alexherbo2@gmail.com> | 2017-01-04 13:04:27 +0100 |
| commit | 671b50bb524ecb7e7654549ab35fd1da0a184a7e (patch) | |
| tree | e420dbabfacf90847f7658e054680a6c5736d45e /rc/base/javascript.kak | |
| parent | 8f821f0fba48366e0407e5cffece9fa5ffa5a67f (diff) | |
update command names
Diffstat (limited to 'rc/base/javascript.kak')
| -rw-r--r-- | rc/base/javascript.kak | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/rc/base/javascript.kak b/rc/base/javascript.kak index 353e156b..dbfa014e 100644 --- a/rc/base/javascript.kak +++ b/rc/base/javascript.kak @@ -8,7 +8,7 @@ hook global BufCreate .*[.](js) %{ # Highlighters # ‾‾‾‾‾‾‾‾‾‾‾‾ -addhl -group / regions -default code javascript \ +add-highlighter -group / regions -default code javascript \ double_string '"' (?<!\\)(\\\\)*" '' \ single_string "'" (?<!\\)(\\\\)*' '' \ comment // '$' '' \ @@ -17,19 +17,19 @@ addhl -group / regions -default code javascript \ # Regular expression flags are: g → global match, i → ignore case, m → multi-lines, y → sticky # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp -addhl -group /javascript/double_string fill string -addhl -group /javascript/single_string fill string -addhl -group /javascript/comment fill comment +add-highlighter -group /javascript/double_string fill string +add-highlighter -group /javascript/single_string fill string +add-highlighter -group /javascript/comment fill comment -addhl -group /javascript/code regex \$\w* 0:identifier -addhl -group /javascript/code regex \b(document|false|null|parent|self|this|true|undefined|window)\b 0:value -addhl -group /javascript/code regex "-?[0-9]*\.?[0-9]+" 0:value -addhl -group /javascript/code regex \b(Array|Boolean|Date|Function|Number|Object|RegExp|String)\b 0:type -addhl -group /javascript/code regex (?<=\W)/[^\n/]+/[gimy]* 0:meta +add-highlighter -group /javascript/code regex \$\w* 0:identifier +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)\b 0:type +add-highlighter -group /javascript/code regex (?<=\W)/[^\n/]+/[gimy]* 0:meta # Keywords are collected at # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords -addhl -group /javascript/code regex \b(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 -group /javascript/code regex \b(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 # ‾‾‾‾‾‾‾‾ @@ -62,7 +62,7 @@ def -hidden _javascript_indent_on_new_line %< # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ -hook -group javascript-highlight global WinSetOption filetype=javascript %{ addhl ref javascript } +hook -group javascript-highlight global WinSetOption filetype=javascript %{ add-highlighter ref javascript } hook global WinSetOption filetype=javascript %{ hook window InsertEnd .* -group javascript-hooks _javascript_filter_around_selections @@ -70,9 +70,9 @@ 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).* %{ rmhl javascript } +hook -group javascript-highlight global WinSetOption filetype=(?!javascript).* %{ remove-highlighter javascript } hook global WinSetOption filetype=(?!javascript).* %{ - rmhooks window javascript-indent - rmhooks window javascript-hooks + remove-hooks window javascript-indent + remove-hooks window javascript-hooks } |
