table of contents
- stretch 0~2016.12.20.1.3a6167ae-1
KAK_HOOKS(1) | hooks | KAK_HOOKS(1) |
NAME¶
hooks - aDESCRIPTION¶
Commands can be registered to be executed when certain events arise. To register a hook use the following command:hook [-group <group>] <scope> <hook_name> <filtering_regex> <commands>
scope can be one of global, buffer or window (c.f. the scopes documentation page).
command is a string containing the commands to execute when the hook is called.
For example to automatically use line numbering with .cc files, use the following command:
hook global WinCreate .*\.cc %{ addhl number_lines }
if group is given, make this hook part of the named group. Groups are used for removing hooks with the following command:
rmhooks <scope> <group>
A call to the command above will remove every hooks in scope that are part of the given group.
DEFAULT HOOKS¶
NormalIdleNormalBegin
NormalEnd
NormalKey
InsertIdle
InsertBegin
InsertEnd
InsertKey
InsertChar
InsertMove
WinCreate
WinClose
WinResize
WinDisplay
WinSetOption
BufSetOption
BufNew
BufOpen
BufCreate
BufWritePre
BufWritePost
BufClose
BufOpenFifo
BufReadFifo
BufCloseFifo
RuntimeError
KakBegin
KakEnd
FocusIn
FocusOut
InsertCompletionShow
InsertCompletionHide
When not specified, the filtering text is an empty string. Note that some hooks will not consider underlying scopes depending on what context they are bound to be run into, e.g. the BufWritePost hook is a buffer hook, and will not consider the window scope.