summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-02-06 23:00:20 +0000
committerMaxime Coste <mawww@kakoune.org>2017-02-06 23:00:20 +0000
commit033ded15ae0d0296f046b6c5feb53ef4e162f2ea (patch)
treedb1cd462cde92475cc9ed49b270f4314e20ae175
parentce2b85ddacfcf9489aff752a98ae2c7797c76882 (diff)
Add proper heredoc highlighting support to sh.kak
-rw-r--r--rc/core/sh.kak10
1 files changed, 6 insertions, 4 deletions
diff --git a/rc/core/sh.kak b/rc/core/sh.kak
index 341114d9..515c2d79 100644
--- a/rc/core/sh.kak
+++ b/rc/core/sh.kak
@@ -2,14 +2,16 @@ hook global BufCreate .*\.(z|ba|c|k)?sh(rc|_profile)? %{
set buffer filetype sh
}
-add-highlighter -group / regions -default code sh \
- double_string %{(?<!\\)(\\\\)*\K"} %{(?<!\\)(\\\\)*"} '' \
- single_string %{(?<!\\)(\\\\)*\K'} %{'} '' \
- comment '(?<!\$)#' '$' ''
+add-highlighter -group / regions -default code -match-capture sh \
+ double_string %{(?<!\\)(?:\\\\)*\K"} %{(?<!\\)(?:\\\\)*"} '' \
+ single_string %{(?<!\\)(?:\\\\)*\K'} %{'} '' \
+ comment '(?<!\$)#' '$' '' \
+ heredoc '<<-?(\w+)' '^\t*(\w+)$' ''
add-highlighter -group /sh/double_string fill string
add-highlighter -group /sh/single_string fill string
add-highlighter -group /sh/comment fill comment
+add-highlighter -group /sh/heredoc fill string
%sh{
# Grammar