From 747fd2cb57d904bc1de353d789df4a4c6e1b888e Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 18 Jul 2025 17:34:44 -0400 Subject: [PATCH] AutoYADM commit: 2025-07-18 17:34:44 --- .config/kak/autoload/local-kakrc.kak | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.config/kak/autoload/local-kakrc.kak b/.config/kak/autoload/local-kakrc.kak index b6118f7f..2783eeb6 100644 --- a/.config/kak/autoload/local-kakrc.kak +++ b/.config/kak/autoload/local-kakrc.kak @@ -1,4 +1,31 @@ provide-module local-kakrc %— + declare-option str local_kakrc_trusted %exp{%val{config}/local_kakrc_trusted.txt} + + # ensures that the file exists + define-command -hidden local-kakrc-ensure-file %{ + nop %sh{ + if [ ! -f "$kak_opt_local_kakrc_trusted" ]; then + mkdir -p "$kak_opt_local_kakrc_trusted" + touch "$kak_opt_local_kakrc_trusted" + fi + } + } + + define-command -params 0..1 local-kakrc-add-trusted %{ + nop %sh{ + if [ "$#" -eq 0 ]; then + arg="$PWD" + else + arg="$(realpath "$1")" + fi + notify-send "$arg" + } + } + + complete-command local-kakrc-add-trusted shell-script-candidates %{ + fd -td --exclude '.git' --base-directory "$PWD" . + } + # syntax highlighting hook global BufCreate (.*/)?\.kakrc %{ set-option buffer filetype kak