diff --git a/src/rc/clang.kak b/src/rc/clang.kak index 72577990a..2e712aee7 100644 --- a/src/rc/clang.kak +++ b/src/rc/clang.kak @@ -29,8 +29,10 @@ def clang-complete %{ } def clang-enable-autocomplete %{ - hook window InsertIdle .* %{ eval -draft %{ + hook window -id clang-autocomplete InsertIdle .* %{ eval -draft %{ exec %sh{ [[ $kak_selection =~ .*(\.|->|::).$ ]] && echo "exec ; echo 'completing...'; clang-complete" } }} } + +def clang-disable-autocomplete %{ rmhooks window clang-autocomplete } diff --git a/src/rc/cpp.kak b/src/rc/cpp.kak index e6111b548..687b25831 100644 --- a/src/rc/cpp.kak +++ b/src/rc/cpp.kak @@ -22,12 +22,13 @@ hook global WinSetOption filetype=cpp %~ addfilter -group cpp-filters regex ^(\h+)([^\n]*[^([{]\h*|$) \n \n$1 addfilter -group cpp-filters regex ^(\h*)[^\n]*[([{]\h* \n '\n$1 ' addfilter -group cpp-filters cleanup_whitespaces - hook window InsertEnd .* %{ exec -draft s\h+$d } + hook window InsertEnd .* -id cpp-hooks %{ exec -draft s\h+$d } ~ hook global WinSetOption filetype=(?!cpp).* %{ rmhl cpp-highlight rmfilter cpp-filters + rmhooks window cpp-hooks } hook global BufNew .*\.(h|hh|hpp|hxx|H) %{ diff --git a/src/rc/ctags.kak b/src/rc/ctags.kak index 12e90cdeb..a761f0a19 100644 --- a/src/rc/ctags.kak +++ b/src/rc/ctags.kak @@ -42,7 +42,9 @@ def funcinfo %{ } def ctags-enable-autoinfo %{ - hook window NormalIdle .* funcinfo - hook window NormalEnd .* info - hook window InsertIdle .* funcinfo + hook window -id ctags-autoinfo NormalIdle .* funcinfo + hook window -id ctags-autoinfo NormalEnd .* info + hook window -id ctags-autoinfo InsertIdle .* funcinfo } + +def ctags-disable-autoinfo %{ rmhooks window ctags-autoinfo } diff --git a/src/rc/grep.kak b/src/rc/grep.kak index 67bd0f221..43252a435 100644 --- a/src/rc/grep.kak +++ b/src/rc/grep.kak @@ -22,9 +22,9 @@ def -shell-params -file-completion \ hook global WinSetOption filetype=grep %{ addhl group grep-highlight addhl -group grep-highlight regex "^([^:]+):(\d+):(\d+)?" 1:cyan 2:green 3:green - hook buffer NormalKey jump + hook buffer -id grep-hooks NormalKey jump } -hook global WinSetOption filetype=(?!grep).* %{ rmhl grep-highlight; } +hook global WinSetOption filetype=(?!grep).* %{ rmhl grep-highlight; rmhooks buffer grep-hooks } def jump %{ exec 'xs^([^:]+):(\d+):(\d+)?'; edit %reg{1} %reg{2} %reg{3} } diff --git a/src/rc/kakrc.kak b/src/rc/kakrc.kak index c132cd14f..223ae6383 100644 --- a/src/rc/kakrc.kak +++ b/src/rc/kakrc.kak @@ -4,7 +4,7 @@ hook global BufCreate (.*/)?(kakrc|.*.kak) %{ hook global WinSetOption filetype=kak %{ addhl group kak-highlight - addhl -group kak-highlight regex \<(hook|addhl|rmhl|addfilter|rmfilter|exec|eval|source|runtime|def|echo|edit|set[gbw])\> 0:keyword + addhl -group kak-highlight regex \<(hook|rmhooks|addhl|rmhl|addfilter|rmfilter|exec|eval|source|runtime|def|decl|echo|edit|set[gbw])\> 0:keyword addhl -group kak-highlight regex \<(default|black|red|green|yellow|blue|magenta|cyan|white)\> 0:value addhl -group kak-highlight regex (?<=\ errjump + hook buffer -id make-hooks NormalKey errjump } -hook global WinSetOption filetype=(?!make).* %{ rmhl make-highlight; } +hook global WinSetOption filetype=(?!make).* %{ rmhl make-highlight; rmhooks buffer make-hooks } def errjump %{ exec 'xs^([^:\n]+):(\d+)(?::(\d+))?:(.*?)$'; edit %reg{1} %reg{2} %reg{3}; echo %reg{4} }