diff --git a/rc/filetype/c-family.kak b/rc/filetype/c-family.kak index 9a6d79e3..ed3978c1 100644 --- a/rc/filetype/c-family.kak +++ b/rc/filetype/c-family.kak @@ -1,3 +1,4 @@ +# Detection hook global BufCreate .*\.(cc|cpp|cxx|C|hh|hpp|hxx|H)$ %{ set-option buffer filetype cpp } @@ -444,3 +445,8 @@ define-command objc-alternative-file -docstring "Jump to the alternate objc file } § + +# Module aliases +provide-module c %{ require-module c-family } +provide-module cpp %{ require-module c-family } +provide-module objc %{ require-module c-family } diff --git a/rc/filetype/javascript.kak b/rc/filetype/javascript.kak index 6f60a4ec..d18aec24 100644 --- a/rc/filetype/javascript.kak +++ b/rc/filetype/javascript.kak @@ -130,3 +130,7 @@ add-highlighter shared/typescript/code/ regex \b(array|boolean|date|number|objec add-highlighter shared/typescript/code/ regex \b(as|constructor|declare|enum|from|implements|interface|module|namespace|package|private|protected|public|readonly|static|type)\b 0:keyword § + +# Aliases +# ‾‾‾‾‾‾‾ +provide-module typescript %{ require-module javascript } diff --git a/rc/filetype/markdown.kak b/rc/filetype/markdown.kak index a8314928..7f9116da 100644 --- a/rc/filetype/markdown.kak +++ b/rc/filetype/markdown.kak @@ -18,6 +18,12 @@ hook global WinSetOption filetype=markdown %{ hook -once -always window WinSetOption filetype=.* %{ remove-hooks window markdown-.+ } } +hook -group markdown-load-languages global WinSetOption filetype=markdown %{ + hook -group markdown-load-languages window NormalIdle .* markdown-load-languages + hook -group markdown-load-languages window InsertIdle .* markdown-load-languages +} + + hook -group markdown-highlight global WinSetOption filetype=markdown %{ add-highlighter window/markdown ref markdown hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/markdown } @@ -89,4 +95,11 @@ define-command -hidden markdown-indent-on-new-line %{ } } +define-command -hidden markdown-load-languages %{ + evaluate-commands -draft %{ try %{ + execute-keys 'gtGbGls```\h*\K[^\s]+' + evaluate-commands -itersel %{ require-module %val{selection} } + }} +} + }