diff options
Diffstat (limited to '.zshrc')
-rw-r--r-- | .zshrc | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/.zshrc b/.zshrc index 6af87b4..97ce5f5 100644 --- a/.zshrc +++ b/.zshrc @@ -57,30 +57,55 @@ 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 add-zsh-hook precmd set_prompt # plugins -source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /Users/venomade/.local/share/zsh-plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh # GHCUP for Haskell [ -f "/home/venomade/.ghcup/env" ] && . "/home/venomade/.ghcup/env" # ghcup-env # 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' |