diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak index ab380b7f..5b456393 100644 --- a/rc/filetype/markdown.kak +++ b/rc/filetype/markdown.kak @@ -16,6 +16,11 @@ hook global WinSetOption filetype=markdown %{ hook window InsertChar \n -group markdown-indent markdown-indent-on-new-line hook -once -always window WinSetOption filetype=.* %{ remove-hooks window markdown-.+ } + + hook -group markdown-load buffer NormalIdle .* %{ try %{ evaluate-commands -draft %{ + execute-keys '%s^\h*```\h*\K[^\n]+$' + evaluate-commands -itersel %{ require-module %val{selection} } + }}} } hook -group markdown-highlight global WinSetOption filetype=markdown %{