typewritten
typewritten copied to clipboard
feat: Implement dynamic left and right prompt prefix options
Closes #148
4 "new" options were implemented:
-
TYPEWRITTEN_LEFT_PROMPT_PREFIX(existed before) -
TYPEWRITTEN_LEFT_PROMPT_PREFIX_FUNCTION -
TYPEWRITTEN_RIGHT_PROMPT_PREFIX -
TYPEWRITTEN_RIGHT_PROMPT_PREFIX_FUNCTION
The _FUNCTION variants are used to enable the use of live evaluated functions as prefixes.
Example of use in .zshrc to display kube context:
display_kube_context() {
tw_kube_context="$(kubectl config current-context 2> /dev/null)"
if [[ $tw_kube_context != "" ]]; then
echo "($(basename $tw_kube_context))"
fi
}
export TYPEWRITTEN_LEFT_PROMPT_PREFIX_FUNCTION=display_kube_context
Hello @KEDLogic ! If you have the chance to review this PR, it would be greatly appreciated. Especially the example snippet for kube context.
@all-contributors please add @KEDLogic for documentation and ideas