summaryrefslogtreecommitdiff
path: root/src/rc/git.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/git.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/git.kak')
-rw-r--r--src/rc/git.kak34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/rc/git.kak b/src/rc/git.kak
index 8b391ce5..14fa37c3 100644
--- a/src/rc/git.kak
+++ b/src/rc/git.kak
@@ -1,23 +1,29 @@
-hook global BufCreate .*COMMIT_EDITMSG \
+hook global BufCreate .*COMMIT_EDITMSG %{
setb filetype git-commit
+}
-hook global WinSetOption filetype=git-commit \
- addhl group git-commit-highlight; \
- addhl -group git-commit-highlight regex "#[^\n]*\n" cyan default; \
- addhl -group git-commit-highlight regex "\<(modified|deleted|new file):[^\n]*\n" magenta default; \
- addhl -group git-commit-highlight regex "\<(modified|deleted|new file):" red default;
+hook global WinSetOption filetype=git-commit %{
+ addhl group git-commit-highlight
+ addhl -group git-commit-highlight regex "#[^\n]*\n" cyan default
+ addhl -group git-commit-highlight regex "\<(modified|deleted|new file):[^\n]*\n" magenta default
+ addhl -group git-commit-highlight regex "\<(modified|deleted|new file):" red default
+}
-hook global WinSetOption filetype=(?!git-commit).* \
+hook global WinSetOption filetype=(?!git-commit).* %{
rmhl git-commit-highlight
+}
-hook global BufCreate .*git-rebase-todo \
+hook global BufCreate .*git-rebase-todo %{
setb filetype git-rebase
+}
-hook global WinSetOption filetype=git-rebase \
- addhl group git-rebase-highlight; \
- addhl -group git-rebase-highlight regex "#[^\n]*\n" cyan default; \
- addhl -group git-rebase-highlight regex "^(pick|edit|reword|squash|fixup|exec|[persfx]) \w+" magenta default; \
- addhl -group git-rebase-highlight regex "^(pick|edit|reword|squash|fixup|exec|[persfx])" green default;
+hook global WinSetOption filetype=git-rebase %{
+ addhl group git-rebase-highlight
+ addhl -group git-rebase-highlight regex "#[^\n]*\n" cyan default
+ addhl -group git-rebase-highlight regex "^(pick|edit|reword|squash|fixup|exec|[persfx]) \w+" magenta default
+ addhl -group git-rebase-highlight regex "^(pick|edit|reword|squash|fixup|exec|[persfx])" green default
+}
-hook global WinSetOption filetype=(?!git-rebase).* \
+hook global WinSetOption filetype=(?!git-rebase).* %{
rmhl git-rebase-highlight
+}