From afd9203dbf45397973467f0f043e1d511824ea40 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Mon, 7 Sep 2015 16:33:38 +0300 Subject: [PATCH 1/5] Fix the format-code alias, remove an unused function --- rc/dlang.kak | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 } From 8bbd292557b3b9b1cafbf8642f8551f1375b9f6e Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Mon, 7 Sep 2015 16:34:41 +0300 Subject: [PATCH 2/5] Fix the format-code alias, remove an unused function --- rc/golang.kak | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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 } From 7ba16e48cdb95849ab5c1db96e3ef7ecac280600 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Tue, 8 Sep 2015 16:32:49 +0300 Subject: [PATCH 3/5] Add "of" to the list of highlighted keywords --- rc/javascript.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/javascript.kak b/rc/javascript.kak index 690ff396..93815911 100644 --- a/rc/javascript.kak +++ b/rc/javascript.kak @@ -33,7 +33,7 @@ addhl -group /javascript/code regex \<(Array|Boolean|Date|Function|Number|Object # 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 # ‾‾‾‾‾‾‾‾ From b3992cfa5a965548205dd0c2335b49f7738c0380 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Fri, 11 Sep 2015 10:40:22 +0300 Subject: [PATCH 4/5] Add basic support for tup's Tupfile format --- rc/tupfile.kak | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 rc/tupfile.kak 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 +} From 83062065b84bd73cb8ca8d712ed910c3e67061b8 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Fri, 11 Sep 2015 11:02:09 +0300 Subject: [PATCH 5/5] Add basic support for integers and floats --- rc/javascript.kak | 1 + 1 file changed, 1 insertion(+) diff --git a/rc/javascript.kak b/rc/javascript.kak index 93815911..6c5e3b10 100644 --- a/rc/javascript.kak +++ b/rc/javascript.kak @@ -29,6 +29,7 @@ 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