diff --git a/rc/dlang.kak b/rc/dlang.kak index 406134be..dda1e6f9 100644 --- a/rc/dlang.kak +++ b/rc/dlang.kak @@ -81,10 +81,6 @@ def dlang-format-dfmt -docstring "Format the code using the dfmt utility" %{ } } -def dlang-disable-dfmt -docstring "Disable automatic code formatting" %{ - rmhooks buffer dlang-formatter -} - # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @@ -97,7 +93,7 @@ hook global WinSetOption filetype=dlang %{ hook window InsertChar \{ -group dlang-indent _dlang-indent-on-opening-curly-brace hook window InsertChar \} -group dlang-indent _dlang-indent-on-closing-curly-brace - alias global format-code dlang-format-dfmt + alias buffer format-code dlang-format-dfmt } hook global WinSetOption filetype=(?!dlang).* %{ @@ -106,5 +102,5 @@ hook global WinSetOption filetype=(?!dlang).* %{ rmhooks window dlang-hooks rmhooks window dlang-indent - unalias global format-code + unalias buffer format-code } diff --git a/rc/golang.kak b/rc/golang.kak index 5f7805fc..aed6d2c0 100644 --- a/rc/golang.kak +++ b/rc/golang.kak @@ -70,11 +70,6 @@ def golang-format-gofmt -docstring "Format the code using the gofmt utility" %{ echo "exec gg ${y}g ${x}l" } } -alias global format-code golang-format-gofmt - -def golang-disable-gofmt -docstring "Disable automatic code formatting" %{ - rmhooks buffer golang-formatter -} # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @@ -88,7 +83,7 @@ hook global WinSetOption filetype=golang %{ hook window InsertChar \{ -group golang-indent _golang-indent-on-opening-curly-brace hook window InsertChar \} -group golang-indent _golang-indent-on-closing-curly-brace - alias global format-code golang-format-gofmt + alias buffer format-code golang-format-gofmt } hook global WinSetOption filetype=(?!golang).* %{ @@ -97,5 +92,5 @@ hook global WinSetOption filetype=(?!golang).* %{ rmhooks window golang-hooks rmhooks window golang-indent - unalias global format-code + unalias buffer format-code } diff --git a/rc/javascript.kak b/rc/javascript.kak index 690ff396..6c5e3b10 100644 --- a/rc/javascript.kak +++ b/rc/javascript.kak @@ -29,11 +29,12 @@ addhl -group /javascript/comment fill comment addhl -group /javascript/code regex \$\w* 0:identifier addhl -group /javascript/code regex \<(document|false|null|parent|self|this|true|undefined|window)\> 0:value +addhl -group /javascript/code regex "-?[0-9]*\.?[0-9]+" 0:value addhl -group /javascript/code regex \<(Array|Boolean|Date|Function|Number|Object|RegExp|String)\> 0:type # Keywords are collected at # https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords -addhl -group /javascript/code regex \<(break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|function|if|import|in|instanceof|let|new|return|super|switch|throw|try|typeof|var|void|while|with|yield)\> 0:keyword +addhl -group /javascript/code regex \<(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)\> 0:keyword # Commands # ‾‾‾‾‾‾‾‾ diff --git a/rc/tupfile.kak b/rc/tupfile.kak new file mode 100644 index 00000000..a9eafff0 --- /dev/null +++ b/rc/tupfile.kak @@ -0,0 +1,38 @@ +# http://gittup.org/tup/ +# + +# Detection +# ‾‾‾‾‾‾‾‾‾ + +hook global BufCreate (.+/)?[Tt]upfile %{ + set buffer mimetype "" + set buffer filetype tupfile +} + +# Highlighters +# ‾‾‾‾‾‾‾‾‾‾‾‾ + +addhl -group / regions -default code tupfile \ + string '"' (?" 0:value +addhl -group /tupfile/code regex "\$\([\w_]+\)" 0:value +addhl -group /tupfile/code regex ":\s*(foreach)\>" 1:keyword +addhl -group /tupfile/code regex "(\.gitignore\>)" 0:keyword +addhl -group /tupfile/code regex "\" 0:keyword +addhl -group /tupfile/code regex "\<(\&?[\w_]+)\s*[:+]?=" 1:keyword + +# Initialization +# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ + +hook global WinSetOption filetype=tupfile %{ + addhl ref tupfile +} + +hook global WinSetOption filetype=(?!tupfile).* %{ + rmhl tupfile +}