diff --git a/.config/kak/autoload/filetype.kak b/.config/kak/autoload/filetype.kak index b1d3093c..35eda053 100644 --- a/.config/kak/autoload/filetype.kak +++ b/.config/kak/autoload/filetype.kak @@ -21,19 +21,20 @@ hook global WinSetOption filetype=kak %{ hook global WinSetOption filetype=typst %{ set-option buffer formatcmd "typstyle --wrap-text" hook -group typst-auto-format window BufWritePre .* format - hook -once -always WinSetOption filetype=.* %{ + hook -once -always window WinSetOption filetype=.* %{ unset-option window formatcmd remove-hooks window typst-auto-format } - define-command -docstring %{ - Spawns a Zathura pdf preview and Typst watcher for the currently open Typst file - } typst %{ - nop %sh{ - { - "$kak_config/scripts/kak-typ-zathura.fish" -k -w "$kak_buffile" "$kak_client_pid" - } > /dev/null 2>&1 < /dev/null & - } - } + define-command -docstring %{ + Spawns a Zathura pdf preview and Typst watcher for the currently open Typst file + } typst %{ + nop %sh{ + { + "$kak_config/scripts/kak-typ-zathura.fish" -k -w "$kak_buffile" "$kak_client_pid" + } > /dev/null 2>&1 < /dev/null & + } + } + nop %sh{ notify-send "4" } } hook global WinSetOption filetype=fish %{ diff --git a/.config/kak/autoload/filetype/typst.kak b/.config/kak/autoload/filetype/typst.kak index 63deab0f..16935786 100644 --- a/.config/kak/autoload/filetype/typst.kak +++ b/.config/kak/autoload/filetype/typst.kak @@ -21,11 +21,13 @@ hook global WinSetOption filetype=typst %( hook window InsertChar \n -group typst-indent typst-indent-on-new-line hook -once -always window WinSetOption filetype=.* %{ remove-hooks window typst-.+ } + nop %sh{ notify-send "2" } ) hook -group typst-highlight global WinSetOption filetype=typst %{ add-highlighter window/typst ref typst hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/typst } + nop %sh{ notify-send "3" } } provide-module typst %~ diff --git a/.config/kak/kakrc b/.config/kak/kakrc index 6c927c07..bb3ebd75 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -95,17 +95,17 @@ map -docstring 'Extend to file end' global user n "gjl" # Zathura pdf preview only for Typst files -hook global WinSetOption filetype=typst %{ - define-command -docstring %{ - Spawns a Zathura pdf preview and Typst watcher for the currently open Typst file - } typst %{ - nop %sh{ - { - "$kak_config/scripts/kak-typ-zathura.fish" -k -w "$kak_buffile" "$kak_client_pid" - } > /dev/null 2>&1 < /dev/null & - } - } -} +# hook global WinSetOption filetype=typst %{ +# define-command -docstring %{ +# Spawns a Zathura pdf preview and Typst watcher for the currently open Typst file +# } typst %{ +# nop %sh{ +# { +# "$kak_config/scripts/kak-typ-zathura.fish" -k -w "$kak_buffile" "$kak_client_pid" +# } > /dev/null 2>&1 < /dev/null & +# } +# } +# } define-command -docstring "Create a scratch buffer" scratch %{ edit -scratch @@ -197,6 +197,3 @@ map -docstring 'popup shell' global user . ': popup-shell' # } # } -hook -once global BufCreate ^(?!(\*scratch\*|\*debug\*)) %{ - delete-buffer *scratch* -}