diff options
Diffstat (limited to '.zshrc')
-rw-r--r-- | .zshrc | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/.zshrc b/.zshrc index 6af87b4..8a2c18e 100644 --- a/.zshrc +++ b/.zshrc @@ -57,20 +57,22 @@ git_dirty() { } set_prompt() { - local user="${USER_COLOR}%n${RESET_COLOR}" - local venv="" - [[ -n "$VIRTUAL_ENV" ]] && venv="${VENV_COLOR}($(basename $VIRTUAL_ENV))${RESET_COLOR} " + if [ "$DEVBOX_SHELL_ENABLED" -ne 1 ]; then + local user="${USER_COLOR}%n${RESET_COLOR}" + local venv="" + [[ -n "$VIRTUAL_ENV" ]] && venv="${VENV_COLOR}($(basename $VIRTUAL_ENV))${RESET_COLOR} " - local path="${DIR_COLOR}$(shorten_path)${RESET_COLOR}" - local git_info="" - local branch="$(git_branch)" + local path="${DIR_COLOR}$(shorten_path)${RESET_COLOR}" + local git_info="" + local branch="$(git_branch)" - if [[ -n "$branch" ]]; then - git_info=" %F{white}on%f ${GIT_COLOR}${branch}${RESET_COLOR}${GIT_DIRTY_COLOR}$(git_dirty)${RESET_COLOR}" - fi + if [[ -n "$branch" ]]; then + git_info=" %F{white}on%f ${GIT_COLOR}${branch}${RESET_COLOR}${GIT_DIRTY_COLOR}$(git_dirty)${RESET_COLOR}" + fi - PROMPT="${user} %F{white}in%f ${venv}${path}${git_info} + PROMPT="${user} %F{white}in%f ${venv}${path}${git_info} ${PROMPT_SYMBOL_COLOR}λ${RESET_COLOR} " + fi } autoload -Uz add-zsh-hook @@ -84,3 +86,26 @@ source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # OPAM for OCaml [[ ! -r '/home/venomade/.opam/opam-init/init.zsh' ]] || source '/home/venomade/.opam/opam-init/init.zsh' > /dev/null 2> /dev/null +# bun completions +[ -s "/home/venomade/.bun/_bun" ] && source "/home/venomade/.bun/_bun" + +# bun +# export BUN_INSTALL="$HOME/.bun" +# export PATH="$BUN_INSTALL/bin:$PATH" + +# Devbox +eval "$(devbox global shellenv)" + +# Function to run emacs based on the presence of devbox.json +run_emacs() { + if [[ $# -eq 0 ]]; then + if [[ -f "devbox.json" ]]; then + devbox run emacs &>/dev/null & + else + emacs + fi + else + command emacs "$@" + fi +} +alias emacs='run_emacs' |