feat: Rework daemon startup and configuration
This commit is contained in:
parent
62d096c111
commit
efa642a14b
1 changed files with 32 additions and 17 deletions
|
@ -26,29 +26,44 @@ content = """
|
|||
}
|
||||
}
|
||||
|
||||
define-command kak-highlight-enable -docstring %{
|
||||
kak-highlight-enable
|
||||
Start a daemon for the current session
|
||||
define-command kak-highlight-enable-window -docstring %{
|
||||
kak-highlight-enable-window
|
||||
Enable the highlighter for this window
|
||||
} %{
|
||||
nop %sh{
|
||||
(eval "${kak_opt_kak_highlight_cmd} --log '${kak_opt_kak_highlight_log}' daemon '${kak_session}'") >/dev/null 2>&1 </dev/null &
|
||||
}
|
||||
|
||||
hook global KakEnd .* %{
|
||||
nop %sh{
|
||||
pkill -f "${kak_opt_kak_highlight_cmd} .* daemon ${kak_session}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hook global WinSetOption filetype=rust %{
|
||||
add-highlighter window/kak_highlight_ranges ranges kak_highlight_ranges
|
||||
|
||||
hook window -group kak-highlight NormalIdle .* kak-highlight
|
||||
hook window -group kak-highlight InsertIdle .* kak-highlight
|
||||
hook window -group kak-highlight BufReload .* kak-highlight
|
||||
|
||||
hook -once -always window WinSetOption filetype=.* %{
|
||||
kak-highlight
|
||||
}
|
||||
|
||||
define-command kak-highlight-disable-window -docstring %{
|
||||
kak-highlight-disable-window
|
||||
Disable the highlighter for this window
|
||||
} %{
|
||||
remove-hooks kak-highlight
|
||||
remove-highlighter window/kak_highlight_ranges
|
||||
}
|
||||
|
||||
define-command kak-highlight-start -docstring %{
|
||||
kak-highlight-start
|
||||
Start the daemon
|
||||
} %{
|
||||
nop %sh{
|
||||
(eval "${kak_opt_kak_highlight_cmd} --log '${kak_opt_kak_highlight_log}' daemon '${kak_session}'") >/dev/null 2>&1 </dev/null &
|
||||
}
|
||||
}
|
||||
|
||||
define-command kak-highlight-stop -docstring %{
|
||||
kak-highlight-stop
|
||||
Stop the daemon
|
||||
} %{
|
||||
nop %sh{
|
||||
pkill -f "${kak_opt_kak_highlight_cmd} .* daemon ${kak_session}"
|
||||
}
|
||||
}
|
||||
|
||||
hook global KakBegin .* kak-highlight-start
|
||||
hook global KakEnd .* kak-highlight-stop
|
||||
|
|
Loading…
Add table
Reference in a new issue