Fix tests and required scripts to get back to green make test

This commit is contained in:
Maxime Coste 2018-06-28 22:10:22 +10:00
parent 1574748d4e
commit f61bcef469
20 changed files with 141 additions and 174 deletions

View File

@ -11,20 +11,19 @@ hook global BufCreate .*[.](fish) %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter shared/ regions -default code fish \ add-highlighter shared/fish regions
double_string '"' (?<!\\)(\\\\)*" '' \ add-highlighter shared/fish/code default-region group
single_string "'" "'" '' \ add-highlighter shared/fish/double_string '"' (?<!\\)(\\\\)*" '' group
comment '#' '$' '' add-highlighter shared/fish/single_string "'" "'" '' fill string
add-highlighter shared/fish/comment '#' '$' '' fill comment
add-highlighter shared/fish/double_string fill string add-highlighter shared/fish/double_string/ fill string
add-highlighter shared/fish/double_string regex (\$\w+)|(\{\$\w+\}) 0:variable add-highlighter shared/fish/double_string/ regex (\$\w+)|(\{\$\w+\}) 0:variable
add-highlighter shared/fish/single_string fill string
add-highlighter shared/fish/comment fill comment
add-highlighter shared/fish/code regex (\$\w+)|(\{\$\w+\}) 0:variable add-highlighter shared/fish/code/ regex (\$\w+)|(\{\$\w+\}) 0:variable
# Command names are collected using `builtin --names` and 'eval' from `functions --names` # Command names are collected using `builtin --names` and 'eval' from `functions --names`
add-highlighter shared/fish/code regex \b(and|begin|bg|bind|block|break|breakpoint|builtin|case|cd|command|commandline|complete|contains|continue|count|echo|else|emit|end|eval|exec|exit|fg|for|function|functions|history|if|jobs|not|or|printf|pwd|random|read|return|set|set_color|source|status|switch|test|ulimit|while)\b 0:keyword add-highlighter shared/fish/code/ regex \b(and|begin|bg|bind|block|break|breakpoint|builtin|case|cd|command|commandline|complete|contains|continue|count|echo|else|emit|end|eval|exec|exit|fg|for|function|functions|history|if|jobs|not|or|printf|pwd|random|read|return|set|set_color|source|status|switch|test|ulimit|while)\b 0:keyword
# Commands # Commands
# ‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾
@ -71,7 +70,7 @@ define-command -hidden fish-insert-on-new-line %{
# Initialization # Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group fish-highlight global WinSetOption filetype=fish %{ add-highlighter window ref fish } hook -group fish-highlight global WinSetOption filetype=fish %{ add-highlighter window/fish ref fish }
hook global WinSetOption filetype=fish %{ hook global WinSetOption filetype=fish %{
hook window InsertChar .* -group fish-indent fish-indent-on-char hook window InsertChar .* -group fish-indent fish-indent-on-char

View File

@ -3,10 +3,10 @@ hook global BufCreate .*(COMMIT_EDITMSG|MERGE_MSG) %{
} }
hook -group git-commit-highlight global WinSetOption filetype=git-commit %{ hook -group git-commit-highlight global WinSetOption filetype=git-commit %{
add-highlighter window group git-commit-highlight add-highlighter window/git-commit-highlight group
add-highlighter window/git-commit-highlight regex "^\h*#[^\n]*\n" 0:cyan,default add-highlighter window/git-commit-highlight/ regex "^\h*#[^\n]*\n" 0:cyan,default
add-highlighter window/git-commit-highlight regex "\b(?:(modified)|(deleted)|(new file)|(renamed|copied)):([^\n]*)\n" 1:yellow 2:red 3:green 4:blue 5:magenta add-highlighter window/git-commit-highlight/ regex "\b(?:(modified)|(deleted)|(new file)|(renamed|copied)):([^\n]*)\n" 1:yellow 2:red 3:green 4:blue 5:magenta
add-highlighter window/git-commit-highlight ref diff # highlight potential diffs from the -v option add-highlighter window/git-commit-highlight/ ref diff # highlight potential diffs from the -v option
} }
hook -group git-commit-highlight global WinSetOption filetype=(?!git-commit).* %{ remove-highlighter window/git-commit-highlight } hook -group git-commit-highlight global WinSetOption filetype=(?!git-commit).* %{ remove-highlighter window/git-commit-highlight }
@ -16,9 +16,9 @@ hook global BufCreate .*git-rebase-todo %{
} }
hook -group git-rebase-highlight global WinSetOption filetype=git-rebase %{ hook -group git-rebase-highlight global WinSetOption filetype=git-rebase %{
add-highlighter window group git-rebase-highlight add-highlighter window/git-rebase-highlight group
add-highlighter window/git-rebase-highlight regex "#[^\n]*\n" 0:cyan,default add-highlighter window/git-rebase-highlight/ regex "#[^\n]*\n" 0:cyan,default
add-highlighter window/git-rebase-highlight regex "^(pick|edit|reword|squash|fixup|exec|delete|[persfxd]) (\w+)" 1:green 2:magenta add-highlighter window/git-rebase-highlight/ regex "^(pick|edit|reword|squash|fixup|exec|delete|[persfx]) (\w+)" 1:green 2:magenta
} }
hook -group git-rebase-highlight global WinSetOption filetype=(?!git-rebase).* %{ remove-highlighter window/git-rebase-highlight } hook -group git-rebase-highlight global WinSetOption filetype=(?!git-rebase).* %{ remove-highlighter window/git-rebase-highlight }

View File

@ -11,24 +11,20 @@ hook global BufCreate .*[.](hs) %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter shared/ regions -default code haskell \ add-highlighter shared/haskell regions
string (?<!'\\)(?<!')" (?<!\\)(\\\\)*" '' \ add-highlighter shared/haskell/code default-region group
macro ^\h*?\K# (?<!\\)\n '' \ add-highlighter shared/haskell/string region (?<!'\\)(?<!')" (?<!\\)(\\\\)*" '' fill string
pragma \{-# '#-\}' \{- \ add-highlighter shared/haskell/macro region ^\h*?\K# (?<!\\)\n '' fill meta
comment \{- -\} \{- \ add-highlighter shared/haskell/pragma region \{-# '#-\}' \{- fill meta
comment --(?:[^!#$%&*+./<>?@\\\^|~=]|$) $ '' add-highlighter shared/haskell/comment region \{- -\} \{- fill comment
add-highlighter shared/haskell/line_comment region -- --(?:[^!#$%&*+./<>?@\\\^|~=]|$) $ '' fill comment
add-highlighter shared/haskell/string fill string add-highlighter shared/haskell/code/ regex (?<!')\b0x+[A-Fa-f0-9]+ 0:value
add-highlighter shared/haskell/comment fill comment add-highlighter shared/haskell/code/ regex (?<!')\b\d+([.]\d+)? 0:value
add-highlighter shared/haskell/pragma fill meta add-highlighter shared/haskell/code/ regex (?<!')\b(import|hiding|qualified|module)(?!')\b 0:keyword
add-highlighter shared/haskell/macro fill meta add-highlighter shared/haskell/code/ regex (?<!')\b(import)(?!')\b[^\n]+(?<!')\b(as)(?!')\b 2:keyword
add-highlighter shared/haskell/code/ regex (?<!')\b(class|data|default|deriving|infix|infixl|infixr|instance|module|newtype|pattern|type|where)(?!')\b 0:keyword
add-highlighter shared/haskell/code regex (?<!')\b0x+[A-Fa-f0-9]+ 0:value add-highlighter shared/haskell/code/ regex (?<!')\b(case|do|else|if|in|let|mdo|of|proc|rec|then)(?!')\b 0:attribute
add-highlighter shared/haskell/code regex (?<!')\b\d+([.]\d+)? 0:value
add-highlighter shared/haskell/code regex (?<!')\b(import|hiding|qualified|module)(?!')\b 0:keyword
add-highlighter shared/haskell/code regex (?<!')\b(import)(?!')\b[^\n]+(?<!')\b(as)(?!')\b 2:keyword
add-highlighter shared/haskell/code regex (?<!')\b(class|data|default|deriving|infix|infixl|infixr|instance|module|newtype|pattern|type|where)(?!')\b 0:keyword
add-highlighter shared/haskell/code regex (?<!')\b(case|do|else|if|in|let|mdo|of|proc|rec|then)(?!')\b 0:attribute
# The complications below is because period has many uses: # The complications below is because period has many uses:
# As function composition operator (possibly without spaces) like "." and "f.g" # As function composition operator (possibly without spaces) like "." and "f.g"
@ -39,32 +35,32 @@ add-highlighter shared/haskell/code regex (?<!')\b(case|do|else|if|in|let|mdo|of
# matches uppercase identifiers: Monad Control.Monad # matches uppercase identifiers: Monad Control.Monad
# not non-space separated dot: Just.const # not non-space separated dot: Just.const
add-highlighter shared/haskell/code regex \b([A-Z]['\w]*\.)*[A-Z]['\w]*(?!['\w])(?![.a-z]) 0:variable add-highlighter shared/haskell/code/ regex \b([A-Z]['\w]*\.)*[A-Z]['\w]*(?!['\w])(?![.a-z]) 0:variable
# matches infix identifier: `mod` `Apa._T'M` # matches infix identifier: `mod` `Apa._T'M`
add-highlighter shared/haskell/code regex `\b([A-Z]['\w]*\.)*[\w]['\w]*` 0:operator add-highlighter shared/haskell/code/ regex `\b([A-Z]['\w]*\.)*[\w]['\w]*` 0:operator
# matches imported operators: M.! M.. Control.Monad.>> # matches imported operators: M.! M.. Control.Monad.>>
# not operator keywords: M... M.-> # not operator keywords: M... M.->
add-highlighter shared/haskell/code regex \b[A-Z]['\w]*\.[~<=>|:!?/.@$*&#%+\^\-\\]+ 0:operator add-highlighter shared/haskell/code/ regex \b[A-Z]['\w]*\.[~<=>|:!?/.@$*&#%+\^\-\\]+ 0:operator
# matches dot: . # matches dot: .
# not possibly incomplete import: a. # not possibly incomplete import: a.
# not other operators: !. .! # not other operators: !. .!
add-highlighter shared/haskell/code regex (?<![\w~<=>|:!?/.@$*&#%+\^\-\\])\.(?![~<=>|:!?/.@$*&#%+\^\-\\]) 0:operator add-highlighter shared/haskell/code/ regex (?<![\w~<=>|:!?/.@$*&#%+\^\-\\])\.(?![~<=>|:!?/.@$*&#%+\^\-\\]) 0:operator
# matches other operators: ... > < <= ^ <*> <$> etc # matches other operators: ... > < <= ^ <*> <$> etc
# not dot: . # not dot: .
# not operator keywords: @ .. -> :: ~ # not operator keywords: @ .. -> :: ~
add-highlighter shared/haskell/code regex (?<![~<=>|:!?/.@$*&#%+\^\-\\])[~<=>|:!?/.@$*&#%+\^\-\\]+ 0:operator add-highlighter shared/haskell/code/ regex (?<![~<=>|:!?/.@$*&#%+\^\-\\])[~<=>|:!?/.@$*&#%+\^\-\\]+ 0:operator
# matches operator keywords: @ -> # matches operator keywords: @ ->
add-highlighter shared/haskell/code regex (?<![~<=>|:!?/.@$*&#%+\^\-\\])(@|~|<-|->|=>|::|=|:|[|])(?![~<=>|:!?/.@$*&#%+\^\-\\]) 1:keyword add-highlighter shared/haskell/code/ regex (?<![~<=>|:!?/.@$*&#%+\^\-\\])(@|~|<-|->|=>|::|=|:|[|])(?![~<=>|:!?/.@$*&#%+\^\-\\]) 1:keyword
# matches: forall [..variables..] . # matches: forall [..variables..] .
# not the variables # not the variables
add-highlighter shared/haskell/code regex \b(forall)\b[^.\n]*?(\.) 1:keyword 2:keyword add-highlighter shared/haskell/code/ regex \b(forall)\b[^.\n]*?(\.) 1:keyword 2:keyword
# matches 'x' '\\' '\'' '\n' '\0' # matches 'x' '\\' '\'' '\n' '\0'
# not incomplete literals: '\' # not incomplete literals: '\'
# not valid identifiers: w' _' # not valid identifiers: w' _'
add-highlighter shared/haskell/code regex \B'([^\\]|[\\]['"\w\d\\])' 0:string add-highlighter shared/haskell/code/ regex \B'([^\\]|[\\]['"\w\d\\])' 0:string
# this has to come after operators so '-' etc is correct # this has to come after operators so '-' etc is correct
# Commands # Commands
@ -95,7 +91,7 @@ define-command -hidden haskell-indent-on-new-line %{
# Initialization # Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group haskell-highlight global WinSetOption filetype=haskell %{ add-highlighter window ref haskell } hook -group haskell-highlight global WinSetOption filetype=haskell %{ add-highlighter window/haskell ref haskell }
hook global WinSetOption filetype=haskell %{ hook global WinSetOption filetype=haskell %{
set-option window extra_word_chars "'" set-option window extra_word_chars "'"

View File

@ -15,26 +15,19 @@ hook global BufCreate .*\.xml %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter shared/ regions html \ add-highlighter shared/html regions
comment <!-- --> '' \ add-highlighter shared/html/comment region <!-- --> '' fill comment
tag < > '' \ add-highlighter shared/html/tag region < > '' regions
style <style\b.*?>\K (?=</style>) '' \ add-highlighter shared/html/style region <style\b.*?>\K (?=</style>) '' ref css
script <script\b.*?>\K (?=</script>) '' add-highlighter shared/html/script region <script\b.*?>\K (?=</script>) '' ref javascript
add-highlighter shared/html/comment fill comment add-highlighter shared/html/tag/base default-region group
add-highlighter shared/html/tag/ region '"' (?<!\\)(\\\\)*" '' fill string
add-highlighter shared/html/tag/ region "'" "'" '' fill string
add-highlighter shared/html/style ref css add-highlighter shared/html/tag/base/ regex \b([a-zA-Z0-9_-]+)=? 1:attribute
add-highlighter shared/html/script ref javascript add-highlighter shared/html/tag/base/ regex </?(\w+) 1:keyword
add-highlighter shared/html/tag/base/ regex <(!DOCTYPE(\h+\w+)+) 1:meta
add-highlighter shared/html/tag regex \b([a-zA-Z0-9_-]+)=? 1:attribute
add-highlighter shared/html/tag regex </?(\w+) 1:keyword
add-highlighter shared/html/tag regex <(!DOCTYPE(\h+\w+)+) 1:meta
add-highlighter shared/html/tag regions content \
string '"' (?<!\\)(\\\\)*" '' \
string "'" "'" ''
add-highlighter shared/html/tag/content/string fill string
# Commands # Commands
# ‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾
@ -65,7 +58,7 @@ define-command -hidden html-indent-on-new-line %{
# Initialization # Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group html-highlight global WinSetOption filetype=(?:html|xml) %{ add-highlighter window ref html } hook -group html-highlight global WinSetOption filetype=(?:html|xml) %{ add-highlighter window/html ref html }
hook global WinSetOption filetype=(?:html|xml) %{ hook global WinSetOption filetype=(?:html|xml) %{
hook window ModeChange insert:.* -group html-hooks html-filter-around-selections hook window ModeChange insert:.* -group html-hooks html-filter-around-selections

View File

@ -11,18 +11,15 @@ hook global BufCreate .*[.](lua) %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter shared/ regions -default code -match-capture lua \ add-highlighter shared/lua regions
string '"' (?<!\\)(?:\\\\)*" '' \ add-highlighter shared/lua/code default-region group
string "'" (?<!\\)(?:\\\\)*' '' \ add-highlighter shared/lua/double_string region '"' (?<!\\)(?:\\\\)*" '' fill string
string '\[(=*)\[' '\](=*)\]' '' \ add-highlighter shared/lua/single_string region "'" (?<!\\)(?:\\\\)*' '' fill string
comment '--\[(=*)\[' '\](=*)\]' '' \ add-highlighter shared/lua/comment region -- '--' $ '' fill comment
comment '--' '$' '' \ add-highlighter shared/lua/raw_string region -match-capture '\[(=*)\[' '\](=*)\]' '' fill string
add-highlighter shared/lua/raw_comment region -match-capture -- '--\[(=*)\[' '\](=*)\]' '' fill comment
add-highlighter shared/lua/string fill string add-highlighter shared/lua/code/ regex \b(and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b 0:keyword
add-highlighter shared/lua/comment fill comment
add-highlighter shared/lua/code regex \b(and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b 0:keyword
# Commands # Commands
# ‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾
@ -87,7 +84,7 @@ define-command -hidden lua-insert-on-new-line %[
# Initialization # Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group lua-highlight global WinSetOption filetype=lua %{ add-highlighter window ref lua } hook -group lua-highlight global WinSetOption filetype=lua %{ add-highlighter window/lua ref lua }
hook global WinSetOption filetype=lua %{ hook global WinSetOption filetype=lua %{
hook window InsertChar .* -group lua-indent lua-indent-on-char hook window InsertChar .* -group lua-indent lua-indent-on-char

View File

@ -11,6 +11,10 @@ hook global BufCreate .*[.](markdown|md|mkd) %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter shared/markdown regions
add-highlighter shared/markdown/content default-region group
add-highlighter shared/markdown/code region ``` ``` '' fill meta
evaluate-commands %sh{ evaluate-commands %sh{
languages=" languages="
c cabal clojure coffee cpp css cucumber d diff dockerfile fish gas go c cabal clojure coffee cpp css cucumber d diff dockerfile fish gas go
@ -18,42 +22,33 @@ evaluate-commands %sh{
lisp lua makefile markdown moon objc perl pug python ragel ruby rust lisp lua makefile markdown moon objc perl pug python ragel ruby rust
sass scala scss sh swift tupfile typescript yaml sass scala scss sh swift tupfile typescript yaml
" "
echo 'add-highlighter shared/ regions -default content markdown \'
for lang in ${languages}; do
printf '%s ```\h*%s\\b ``` "" ' "${lang}" "${lang}"
done
echo 'code ``` ``` ""'
for lang in ${languages}; do for lang in ${languages}; do
printf 'add-highlighter shared/markdown/%s region ```\h*%s\\b ``` "" regions\n' "${lang}" "${lang}"
printf 'add-highlighter shared/markdown/%s/ default-region fill meta\n' "${lang}"
ref=$([ "${lang}" = kak ] && echo kakrc || echo "${lang}") ref=$([ "${lang}" = kak ] && echo kakrc || echo "${lang}")
printf ' printf 'add-highlighter shared/markdown/%s/inner region \A```[^\\n]*\K (?=```) "" ref %s\n' "${lang}" "${ref}"
add-highlighter shared/markdown/%s/ regions -default fence outer inner \A```[^\\n]*\K (?=```) ""
add-highlighter shared/markdown/%s/outer/fence fill meta
add-highlighter shared/markdown/%s/outer/inner ref %s
' "${lang}" "${lang}" "${lang}" "${ref}"
done done
} }
add-highlighter shared/markdown/code fill meta
# Setext-style header # Setext-style header
add-highlighter shared/markdown/content regex (\A|\n\n)[^\n]+\n={2,}\h*\n\h*$ 0:title add-highlighter shared/markdown/content/ regex (\A|\n\n)[^\n]+\n={2,}\h*\n\h*$ 0:title
add-highlighter shared/markdown/content regex (\A|\n\n)[^\n]+\n-{2,}\h*\n\h*$ 0:header add-highlighter shared/markdown/content/ regex (\A|\n\n)[^\n]+\n-{2,}\h*\n\h*$ 0:header
# Atx-style header # Atx-style header
add-highlighter shared/markdown/content regex ^(#+)(\h+)([^\n]+) 1:header add-highlighter shared/markdown/content/ regex ^(#+)(\h+)([^\n]+) 1:header
add-highlighter shared/markdown/content regex ^\h?((?:[\s\t]+)?[-\*])\h+[^\n]*(\n\h+[^-\*]\S+[^\n]*\n)*$ 0:list 1:bullet add-highlighter shared/markdown/content/ regex ^\h?((?:[\s\t]+)?[-\*])\h+[^\n]*(\n\h+[^-\*]\S+[^\n]*\n)*$ 0:list 1:bullet
add-highlighter shared/markdown/content regex \B\+[^\n]+?\+\B 0:mono add-highlighter shared/markdown/content/ regex \B\+[^\n]+?\+\B 0:mono
add-highlighter shared/markdown/content regex [^`](`([^\s`]|([^\s`](\n?[^\n`])*[^\s`]))`)[^`] 1:mono add-highlighter shared/markdown/content/ regex [^`](`([^\s`]|([^\s`](\n?[^\n`])*[^\s`]))`)[^`] 1:mono
add-highlighter shared/markdown/content regex [^`](``([^\s`]|([^\s`](\n?[^\n`])*[^\s`]))``)[^`] 1:mono add-highlighter shared/markdown/content/ regex [^`](``([^\s`]|([^\s`](\n?[^\n`])*[^\s`]))``)[^`] 1:mono
add-highlighter shared/markdown/content regex [^*](\*([^\s*]|([^\s*](\n?[^\n*])*[^\s*]))\*)[^*] 1:italic add-highlighter shared/markdown/content/ regex [^*](\*([^\s*]|([^\s*](\n?[^\n*])*[^\s*]))\*)[^*] 1:italic
add-highlighter shared/markdown/content regex [^_](_([^\s_]|([^\s_](\n?[^\n_])*[^\s_]))_)[^_] 1:italic add-highlighter shared/markdown/content/ regex [^_](_([^\s_]|([^\s_](\n?[^\n_])*[^\s_]))_)[^_] 1:italic
add-highlighter shared/markdown/content regex [^*](\*\*([^\s*]|([^\s*](\n?[^\n*])*[^\s*]))\*\*)[^*] 1:bold add-highlighter shared/markdown/content/ regex [^*](\*\*([^\s*]|([^\s*](\n?[^\n*])*[^\s*]))\*\*)[^*] 1:bold
add-highlighter shared/markdown/content regex [^_](__([^\s_]|([^\s_](\n?[^\n_])*[^\s_]))__)[^_] 1:bold add-highlighter shared/markdown/content/ regex [^_](__([^\s_]|([^\s_](\n?[^\n_])*[^\s_]))__)[^_] 1:bold
add-highlighter shared/markdown/content regex <(([a-z]+://.*?)|((mailto:)?[\w+-]+@[a-z]+[.][a-z]+))> 0:link add-highlighter shared/markdown/content/ regex <(([a-z]+://.*?)|((mailto:)?[\w+-]+@[a-z]+[.][a-z]+))> 0:link
add-highlighter shared/markdown/content regex ^\[[^\]\n]*\]:\h*([^\n]*) 1:link add-highlighter shared/markdown/content/ regex ^\[[^\]\n]*\]:\h*([^\n]*) 1:link
add-highlighter shared/markdown/content regex ^\h*(>\h*)+ 0:comment add-highlighter shared/markdown/content/ regex ^\h*(>\h*)+ 0:comment
add-highlighter shared/markdown/content regex \H\K\h\h$ 0:PrimarySelection add-highlighter shared/markdown/content/ regex \H\K\h\h$ 0:PrimarySelection
# Commands # Commands
# ‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾
@ -72,7 +67,7 @@ define-command -hidden markdown-indent-on-new-line %{
# Initialization # Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group markdown-highlight global WinSetOption filetype=markdown %{ add-highlighter window ref markdown } hook -group markdown-highlight global WinSetOption filetype=markdown %{ add-highlighter window/markdown ref markdown }
hook global WinSetOption filetype=markdown %{ hook global WinSetOption filetype=markdown %{
hook window InsertChar \n -group markdown-indent markdown-indent-on-new-line hook window InsertChar \n -group markdown-indent markdown-indent-on-new-line

View File

@ -11,43 +11,34 @@ hook global BufCreate .*(([.](rb))|(irbrc)|(pryrc)|(Capfile|[.]cap)|(Gemfile|[.]
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter shared/ regions -default code -match-capture ruby \ add-highlighter shared/ruby regions
double_string '"' (?<!\\)(\\\\)*" '' \ add-highlighter shared/ruby/code default-region group
single_string "'" (?<!\\)(\\\\)*' '' \ add-highlighter shared/ruby/double_string region '"' (?<!\\)(\\\\)*" '' regions
backtick '`' (?<!\\)(\\\\)*` '' \ add-highlighter shared/ruby/single_string region "'" (?<!\\)(\\\\)*' '' fill string
regex '/' (?<!\\)(\\\\)*/[imox]* '' \ add-highlighter shared/ruby/backtick region '`' (?<!\\)(\\\\)*` '' regions
comment '#' '$' '' \ add-highlighter shared/ruby/regex region '/' (?<!\\)(\\\\)*/[imox]* '' regions
comment ^begin= ^=end '' \ add-highlighter shared/ruby/ region '#' '$' '' fill comment
literal '%[iqrswxIQRSWX]\(' \) \( \ add-highlighter shared/ruby/ region ^begin= ^=end '' fill comment
literal '%[iqrswxIQRSWX]\{' \} \{ \ add-highlighter shared/ruby/ region '%[iqrswxIQRSWX]\(' \) \( fill meta
literal '%[iqrswxIQRSWX]\[' \] \[ \ add-highlighter shared/ruby/ region '%[iqrswxIQRSWX]\{' \} \{ fill meta
literal '%[iqrswxIQRSWX]<' > < \ add-highlighter shared/ruby/ region '%[iqrswxIQRSWX]\[' \] \[ fill meta
heredoc '<<[-~]?(\w+)' '^\h*(\w+)$' '' \ add-highlighter shared/ruby/ region '%[iqrswxIQRSWX]<' > < fill meta
division '[\w\)\]](/|(\h+/\h+))' '\w' '' # Help Kakoune to better detect /…/ literals add-highlighter shared/ruby/heredoc region '<<[-~]?(\w+)' '^\h*(\w+)$' '' fill string
add-highlighter shared/ruby/division region '[\w\)\]](/|(\h+/\h+))' '\w' '' group # Help Kakoune to better detect /…/ literals
# Regular expression flags are: i → ignore case, m → multi-lines, o → only interpolate #{} blocks once, x → extended mode (ignore white spaces) # Regular expression flags are: i → ignore case, m → multi-lines, o → only interpolate #{} blocks once, x → extended mode (ignore white spaces)
# Literals are: i → array of symbols, q → string, r → regular expression, s → symbol, w → array of words, x → capture shell result # Literals are: i → array of symbols, q → string, r → regular expression, s → symbol, w → array of words, x → capture shell result
add-highlighter shared/ruby/double_string fill string add-highlighter shared/ruby/double_string/ default-region fill string
add-highlighter shared/ruby/double_string regions regions interpolation \Q#{ \} \{ add-highlighter shared/ruby/double_string/interpolation region \Q#{ \} \{ fill meta
add-highlighter shared/ruby/double_string/regions/interpolation fill meta
add-highlighter shared/ruby/single_string fill string add-highlighter shared/ruby/backtick/ default-region fill meta
add-highlighter shared/ruby/heredoc fill string add-highlighter shared/ruby/backtick/interpolation region \Q#{ \} \{ fill meta
add-highlighter shared/ruby/backtick fill meta add-highlighter shared/ruby/regex/ default-region fill meta
add-highlighter shared/ruby/backtick regions regions interpolation \Q#{ \} \{ add-highlighter shared/ruby/regex/interpolation region \Q#{ \} \{ fill meta
add-highlighter shared/ruby/backtick/regions/interpolation fill meta
add-highlighter shared/ruby/regex fill meta add-highlighter shared/ruby/code/ regex \b([A-Za-z]\w*:(?!:))|([$@][A-Za-z]\w*)|((?<!:):(([A-Za-z]\w*[=?!]?)|(\[\]=?)))|([A-Z]\w*|^|\h)\K::(?=[A-Z]) 0:variable
add-highlighter shared/ruby/regex regions regions interpolation \Q#{ \} \{
add-highlighter shared/ruby/regex/regions/interpolation fill meta
add-highlighter shared/ruby/comment fill comment
add-highlighter shared/ruby/literal fill meta
add-highlighter shared/ruby/code regex \b([A-Za-z]\w*:(?!:))|([$@][A-Za-z]\w*)|((?<!:):(([A-Za-z]\w*[=?!]?)|(\[\]=?)))|([A-Z]\w*|^|\h)\K::(?=[A-Z]) 0:variable
evaluate-commands %sh{ evaluate-commands %sh{
# Grammar # Grammar
@ -67,10 +58,10 @@ evaluate-commands %sh{
# Highlight keywords # Highlight keywords
printf %s " printf %s "
add-highlighter shared/ruby/code regex \b(${keywords})\b 0:keyword add-highlighter shared/ruby/code/ regex \b(${keywords})\b 0:keyword
add-highlighter shared/ruby/code regex \b(${attributes})\b 0:attribute add-highlighter shared/ruby/code/ regex \b(${attributes})\b 0:attribute
add-highlighter shared/ruby/code regex \b(${values})\b 0:value add-highlighter shared/ruby/code/ regex \b(${values})\b 0:value
add-highlighter shared/ruby/code regex \b(${meta})\b 0:meta add-highlighter shared/ruby/code/ regex \b(${meta})\b 0:meta
" "
} }
@ -153,7 +144,7 @@ define-command -hidden ruby-insert-on-new-line %[
# Initialization # Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group ruby-highlight global WinSetOption filetype=ruby %{ add-highlighter window ref ruby } hook -group ruby-highlight global WinSetOption filetype=ruby %{ add-highlighter window/ruby ref ruby }
hook global WinSetOption filetype=ruby %{ hook global WinSetOption filetype=ruby %{
hook window InsertChar .* -group ruby-indent ruby-indent-on-char hook window InsertChar .* -group ruby-indent ruby-indent-on-char

View File

@ -11,20 +11,18 @@ hook global BufCreate .*[.](sass) %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
add-highlighter shared/ regions -default code sass \ add-highlighter shared/sass regions
string '"' (?<!\\)(\\\\)*" '' \ add-highlighter shared/sass/code default-region group
string "'" "'" '' \ add-highlighter shared/sass/single_string region '"' (?<!\\)(\\\\)*" '' fill string
comment '/' '$' '' add-highlighter shared/sass/double_string region "'" "'" '' fill string
add-highlighter shared/sass/comment region '/' '$' '' fill comment
add-highlighter shared/sass/string fill string add-highlighter shared/sass/code/ regex [*]|[#.][A-Za-z][A-Za-z0-9_-]* 0:variable
add-highlighter shared/sass/comment fill comment add-highlighter shared/sass/code/ regex &|@[A-Za-z][A-Za-z0-9_-]* 0:meta
add-highlighter shared/sass/code/ regex (#[0-9A-Fa-f]+)|((\d*\.)?\d+(em|px)) 0:value
add-highlighter shared/sass/code regex [*]|[#.][A-Za-z][A-Za-z0-9_-]* 0:variable add-highlighter shared/sass/code/ regex ([A-Za-z][A-Za-z0-9_-]*)\h*: 1:keyword
add-highlighter shared/sass/code regex &|@[A-Za-z][A-Za-z0-9_-]* 0:meta add-highlighter shared/sass/code/ regex :(before|after) 0:attribute
add-highlighter shared/sass/code regex (#[0-9A-Fa-f]+)|((\d*\.)?\d+(em|px)) 0:value add-highlighter shared/sass/code/ regex !important 0:keyword
add-highlighter shared/sass/code regex ([A-Za-z][A-Za-z0-9_-]*)\h*: 1:keyword
add-highlighter shared/sass/code regex :(before|after) 0:attribute
add-highlighter shared/sass/code regex !important 0:keyword
# Commands # Commands
# ‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾
@ -50,7 +48,7 @@ define-command -hidden sass-indent-on-new-line %{
# Initialization # Initialization
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
hook -group sass-highlight global WinSetOption filetype=sass %{ add-highlighter window ref sass } hook -group sass-highlight global WinSetOption filetype=sass %{ add-highlighter window/sass ref sass }
hook global WinSetOption filetype=sass %{ hook global WinSetOption filetype=sass %{
hook window ModeChange insert:.* -group sass-hooks sass-filter-around-selections hook window ModeChange insert:.* -group sass-hooks sass-filter-around-selections

View File

@ -1,5 +1,5 @@
add-highlighter window number_lines add-highlighter window/ number_lines
set window tabstop 4 set window tabstop 4
add-highlighter window column 3 default,red add-highlighter window/ column 3 default,red
add-highlighter window column 7 default,green add-highlighter window/ column 7 default,green
add-highlighter window column 5 default,blue add-highlighter window/ column 5 default,blue

View File

@ -1,7 +1,4 @@
add-highlighter window regions -default code regions_test \ add-highlighter window/regions_test regions
string %{"} %{(?<!\\)(\\\\)*"} '' \ add-highlighter window/regions_test/code default-region fill yellow
shell '\$\{' '\}' '\{' add-highlighter window/regions_test/string region %{"} %{(?<!\\)(\\\\)*"} '' fill green
add-highlighter window/regions_test/shell region '\$\{' '\}' '\{' fill red
add-highlighter window/regions_test/code fill yellow
add-highlighter window/regions_test/string fill green
add-highlighter window/regions_test/shell fill red

View File

@ -1 +1 @@
add-highlighter window wrap -word add-highlighter window/ wrap -word

View File

@ -1,2 +1,3 @@
add-highlighter window regions -default code -match-capture sh \ add-highlighter window/sh regions
heredoc '<<-?(\w+)' '^\t*(\w+)$' '' add-highlighter window/sh/code default-region group
add-highlighter window/sh/heredoc region -match-capture '<<-?(\w+)' '^\t*(\w+)$' '' group

View File

@ -1 +1 @@
add-highlighter window column 20 default,blue add-highlighter window/ column 20 default,blue

View File

@ -1,2 +1,2 @@
add-highlighter window wrap add-highlighter window/ wrap
set global scrolloff 1,0 set global scrolloff 1,0

View File

@ -1 +1 @@
add-highlighter window show_whitespaces add-highlighter window/ show_whitespaces

View File

@ -1 +1 @@
add-highlighter window show_whitespaces add-highlighter window/ show_whitespaces

View File

@ -1 +1 @@
add-highlighter window wrap add-highlighter window/ wrap

View File

@ -1 +1 @@
add-highlighter window wrap add-highlighter window/ wrap

View File

@ -1 +1 @@
add-highlighter window number_lines add-highlighter window/ number_lines

View File

@ -1 +1 @@
add-highlighter window regex '[“”]' 0:red add-highlighter window/ regex '[“”]' 0:red