set own theme

This commit is contained in:
2024-10-30 12:37:58 +01:00
parent 683edf44ec
commit 5b69c9bdc3
9 changed files with 234 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
# Neue Funktionen für die Versionsinformationen
function get_node_version() {
if [[ -f package.json ]]; then
if [[ -f pnpm-lock.yaml ]]; then
echo "%F{magenta}pnpm $(pnpm --version)%f "
elif [[ -f package-lock.json ]]; then
echo "%F{red}npm $(npm --version)%f "
fi
fi
}
function get_deno_version() {
if [[ -f deno.json || -f deno.jsonc ]]; then
echo "%F{green}deno $(deno --version | head -n1 | cut -d' ' -f2)%f "
fi
}
# Aktualisierte Prompt-Funktion
function set_prompt() {
if [[ -n "$SSH_CONNECTION" ]]; then
local user_host="%B%F{yellow}server%f%b"
else
local user_host="%B%F{green}local%f%b"
fi
local user_symbol='%(!.#.$)'
local current_dir="%B%F{blue}%~%f%b "
local conda_info=$(conda_prompt_info)
local vcs_info="$(git_prompt_info)"
local ruby_info=$(ruby_prompt_info)
local venv_info=$(virtualenv_prompt_info)
local kube_info=$(get_kubectl_context)
local node_info=$(get_node_version)
local deno_info=$(get_deno_version)
PS1="${conda_info}${user_host}${current_dir}${node_info}${deno_info}${ruby_info}${vcs_info}${venv_info}${kube_info}
△ %B${user_symbol}%b "
RPROMPT="%B${return_code}%b"
}
precmd_functions+=(set_prompt)