diff --git a/_src.posix/private_dot_config/sz.env/zzz_chezmoi.env.tmpl b/_src.posix/private_dot_config/sz.env/zzz_chezmoi.env.tmpl index 0e5ce42..aed37de 100644 --- a/_src.posix/private_dot_config/sz.env/zzz_chezmoi.env.tmpl +++ b/_src.posix/private_dot_config/sz.env/zzz_chezmoi.env.tmpl @@ -13,9 +13,18 @@ if is_cmd 'chezmoi'; then complete -F _complete_alias czg - czcd() { - cd "$(chezmoi source-path "${@}")" + chezmoi() { + ${SET_X:-:} -x + local _args=() + [ $# -ge 2 ] && _args=("${@:2}") + case "$1" in + "cd") cd "$(command chezmoi source-path "${_args[@]}")" ;; + "edit") ${VISUAL:-${EDITOR:-vi}} $(command chezmoi sourch-path "${_args[@]}") ;; + *) command chezmoi "${@}" ;; + esac + ${SET_X:-:} +x } + czcd() { chezmoi cd "${@}"; } czedext() { local CZ_EXT="$(find $(chezmoi source-path) -mindepth 1 -maxdepth 1 -name '.chezmoiexternal.*')" CZ_EXT="${CZ_EXT:-$(chezmoi source-path "${@}")/.chezmoiexternal.yaml.tmpl}"