Before MacOS
This commit is contained in:
1 parent
e9d31e5cef
commit
edcf5dd381
5 files changed
+265
-130
No files matched your search
@@ -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'
|
||||
Reference in new issue
Block a user