From d1c4a655b92ab4d1a192cd038e2b6991962dd160 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 15 Jun 2012 14:24:57 +0200 Subject: [PATCH] git.kak: use filetype option --- src/rc/git.kak | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/rc/git.kak b/src/rc/git.kak index daf8c6a0..8b391ce5 100644 --- a/src/rc/git.kak +++ b/src/rc/git.kak @@ -1,12 +1,23 @@ -hook global WinCreate .*COMMIT_EDITMSG \ - addhl group hlgit; \ - addhl -group hlgit regex "#[^\n]*\n" cyan default; \ - addhl -group hlgit regex "\<(modified|deleted|new file):[^\n]*\n" magenta default; \ - addhl -group hlgit regex "\<(modified|deleted|new file):" red default; +hook global BufCreate .*COMMIT_EDITMSG \ + setb filetype git-commit -hook global WinCreate .*git-rebase-todo \ - addhl group hlgit; \ - addhl -group hlgit regex "#[^\n]*\n" cyan default; \ - addhl -group hlgit regex "^(pick|edit|reword|squash|fixup|exec|[persfx]) \w+" magenta default; \ - addhl -group hlgit regex "^(pick|edit|reword|squash|fixup|exec|[persfx])" green 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).* \ + rmhl git-commit-highlight + +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).* \ + rmhl git-rebase-highlight