Add proper heredoc highlighting support to sh.kak

This commit is contained in:
Maxime Coste 2017-02-06 23:00:20 +00:00
parent ce2b85ddac
commit 033ded15ae

View File

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