diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-01-10 13:44:11 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-01-10 13:44:11 +0000 |
| commit | 343df600cb9e0ffb8ba188e739ab3fcf86253938 (patch) | |
| tree | 88757fabf7e6ad8fe176403426b507ddf4b96b38 /rc/base/javascript.kak | |
| parent | 1d30794f6318838051af0b03e40a69c92e2b600c (diff) | |
| parent | 671b50bb524ecb7e7654549ab35fd1da0a184a7e (diff) | |
Merge remote-tracking branch 'alexherbo2/command-names'
Diffstat (limited to 'rc/base/javascript.kak')
| -rw-r--r-- | rc/base/javascript.kak | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/rc/base/javascript.kak b/rc/base/javascript.kak index 1a084c24..a2ca6473 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 "'" (?<!\\)(\\\\)*' '' \ literal "`" (?<!\\)(\\\\)*` '' \ @@ -18,21 +18,21 @@ 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 -addhl -group /javascript/literal fill string -addhl -group /javascript/literal regex \${.*?} 0:value +add-highlighter -group /javascript/double_string fill string +add-highlighter -group /javascript/single_string fill string +add-highlighter -group /javascript/comment fill comment +add-highlighter -group /javascript/literal fill string +add-highlighter -group /javascript/literal regex \${.*?} 0:value -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 # ‾‾‾‾‾‾‾‾ @@ -65,7 +65,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 @@ -73,9 +73,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 } |
