From 36070dd429af69f1042f4ee56488a960c4d8e7ef Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 31 Jul 2012 14:22:57 +0200 Subject: CommandManager: rework command parser a new type of strings is supported inspired by the ruby strings. %content, 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 %shcommand 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 } } --- src/rc/git.kak | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'src/rc/git.kak') 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 +} -- cgit v1.2.3