Apply some recommendations from git dx book

This commit is contained in:
Maximilian Friedersdorff 2024-12-02 12:13:41 +00:00
parent 82e3fa9114
commit 911dd07d1e
9 changed files with 114 additions and 37 deletions

View file

@ -28,16 +28,6 @@ unsetopt beep notify
bindkey -v
# End of lines configured by zsh-newuser-install
# Prompt
NEWLINE=$'\n'
setopt prompt_subst
p="%(?;%F{green};%F{red})[%h]%f "
p+="%F{red}%B%n%b%f@%F{red}%B%m%b%f"
p+=":%F{blue}%~%f"
p+="${NEWLINE}%(!.#.$) "
virtual_env() {
if [ -n "${VIRTUAL_ENV+1}" ]; then
home_rel_path=$(echo ${VIRTUAL_ENV} | sed "s;^${HOME};~;")
@ -45,11 +35,6 @@ virtual_env() {
fi
}
source ~/.git-prompt.sh
precmd () {
__git_ps1 "" "$(virtual_env)${p}" "${NEWLINE}[%s]${NEWLINE}"
}
bindkey '^R' history-incremental-search-backward
if [[ -f ~/.shell_aliases ]]; then
@ -106,3 +91,5 @@ scrot() {
grim -g "$(slurp)" "$tmp_file"
echo "$tmp_file"
}
eval "$(starship init zsh)"