summaryrefslogtreecommitdiff
path: root/src/rc/diff.kak
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-07-31 14:22:57 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-07-31 14:22:57 +0200
commit36070dd429af69f1042f4ee56488a960c4d8e7ef (patch)
treebdf9ab393e5b8e632a46319d4d3923fe19608e37 /src/rc/diff.kak
parentac2676cbcfa3be81b6136efc28b009bc25489c30 (diff)
CommandManager: rework command parser
a new type of strings is supported inspired by the ruby strings. %<delimiter>content<delimiter>, if opening delimiter is one of ([{<, then closing delimiter is the matching )]}> and balanced delimiters in the string needs not to be escaped, else the closing delimiter is the same as the opening one. shell expansion is available through %sh<delimiter>command<delimiter> syntax. Command flags have been removed, as these strings provide proper nesting support, so now, you can for example do: def command %{ echo %sh{ ls } }
Diffstat (limited to 'src/rc/diff.kak')
-rw-r--r--src/rc/diff.kak17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/rc/diff.kak b/src/rc/diff.kak
index 8a9a390f..434026ab 100644
--- a/src/rc/diff.kak
+++ b/src/rc/diff.kak
@@ -1,11 +1,14 @@
-hook global BufCreate .*\.(diff|patch) \
+hook global BufCreate .*\.(diff|patch) %{
setb filetype diff
+}
-hook global WinSetOption filetype=diff \
- addhl group diff-highlight; \
- addhl -group diff-highlight regex "^\+[^\n]*\n" green default; \
- addhl -group diff-highlight regex "^-[^\n]*\n" red default; \
- addhl -group diff-highlight regex "^@@[^\n]*@@" cyan default;
+hook global WinSetOption filetype=diff %{
+ addhl group diff-highlight
+ addhl -group diff-highlight regex "^\+[^\n]*\n" green default
+ addhl -group diff-highlight regex "^-[^\n]*\n" red default
+ addhl -group diff-highlight regex "^@@[^\n]*@@" cyan default
+}
-hook global WinSetOption filetype=(?!diff).* \
+hook global WinSetOption filetype=(?!diff).* %{
rmhl diff-highlight
+}