1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-25 20:41:49 +03:00

Merge remote-tracking branches 'lenormf/rc/{dlang,golang,javascript,tupfile}.kak'

This commit is contained in:
Maxime Coste 2015-09-11 11:50:06 +01:00
4 changed files with 44 additions and 14 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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
# ‾‾‾‾‾‾‾‾

38
rc/tupfile.kak Normal file
View File

@ -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 '"' (?<!\\)(\\\\)*" '' \
comment '#' $ ''
addhl -group /tupfile/string fill string
addhl -group /tupfile/comment fill comment
addhl -group /tupfile/code regex "\%[fbBeoOdg]\>" 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 "\<ifn?eq|ifn?def|else|endif|error|include|include_rules|run|preload|export\>" 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
}