Improved startup performance and switched pkg managers

This commit is contained in:
2021-07-26 04:40:27 +01:00
parent d095509d3a
commit 3335b8fd82
4 changed files with 21 additions and 32 deletions

View File

@@ -1,15 +1,16 @@
export ZSH="$HOME/.oh-my-zsh"
plugins=(
git
docker
zsh-completions
asdf
aws
zsh-syntax-highlighting
zsh-autosuggestions
)
autoload -U compinit && compinit
fpath=($fpath ~/.zsh/completion)
DISABLE_UNTRACKED_FILES_DIRTY="true"
source $ZSH/oh-my-zsh.sh
# History
@@ -37,19 +38,17 @@ title() { export TITLE_OVERRIDDEN=1; echo -en "\e]0;$*\a"}
autotitle() { export TITLE_OVERRIDDEN=0 }; autotitle
# Condition checking if title is overridden
overridden() { [[ $TITLE_OVERRIDDEN == 1 ]]; }
# Echo asterisk if git state is dirty
gitDirty() { [[ $(git status 2> /dev/null | grep -o '\w\+' | tail -n1) != ("clean"|"") ]] && echo "*" }
# Show cwd when shell prompts for input.
precmd() {
if overridden; then return; fi
pwd=$(pwd) # Store full path as variable
cwd=${pwd##*/} # Extract current working dir only
print -Pn "\e]0;$cwd$(gitDirty)\a" # Replace with $pwd to show full path
print -Pn "\e]0;$cwd\a" # Replace with $pwd to show full path
}
# Prepend command (w/o arguments) to cwd while waiting for command to complete.
preexec() {
if overridden; then return; fi
printf "\033]0;%s\a" "${1%% *} | $cwd$(gitDirty)" # Omit construct from $1 to show args
printf "\033]0;%s\a" "${1%% *} | $cwd" # Omit construct from $1 to show args
}