65 lines
1.6 KiB
Bash
65 lines
1.6 KiB
Bash
[ -f "$HOME/.config/shell/alias" ] && source "$HOME/.config/shell/alias"
|
|
|
|
bindkey -e
|
|
|
|
export HISTFILE="$XDG_STATE_HOME"/zsh/history
|
|
HISTSIZE=1000000
|
|
SAVEHIST=1000000
|
|
HISTCONTROL=ignoreboth
|
|
|
|
setopt append_history
|
|
setopt inc_append_history
|
|
setopt share_history
|
|
setopt autocd
|
|
setopt extendedglob
|
|
setopt nomatch
|
|
setopt notify
|
|
setopt auto_param_slash
|
|
setopt auto_menu
|
|
setopt menu_complete
|
|
unsetopt beep
|
|
unsetopt prompt_sp
|
|
|
|
autoload -U colors && colors
|
|
|
|
# The following lines were added by compinstall
|
|
zstyle :compinstall filename '/home/dominic/.zshrc'
|
|
|
|
autoload -Uz compinit
|
|
if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then
|
|
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
|
else
|
|
compinit -C
|
|
fi
|
|
# End of lines added by compinstall
|
|
|
|
# THEME ########################################
|
|
# 1. Enable Git branch info
|
|
autoload -Uz vcs_info
|
|
precmd() { vcs_info }
|
|
zstyle ':vcs_info:git:*' formats '(%b)'
|
|
|
|
# 2. Enable variable expansion in the prompt
|
|
setopt PROMPT_SUBST
|
|
|
|
# 3. Define a function to show the Python venv name
|
|
python_venv() {
|
|
if [[ -n "$VIRTUAL_ENV" ]]; then
|
|
echo "(${VIRTUAL_ENV:t}) "
|
|
fi
|
|
}
|
|
|
|
# 4. Set the prompt (e.g., [venv] path (branch) %)
|
|
PROMPT=$'%F{2}$(python_venv)%f%F{4}%n@%m:%~%f %F{1}${vcs_info_msg_0_}%f \n>>> %F{white}'
|
|
# END THEME ######################################
|
|
|
|
|
|
# custom stuff
|
|
zstyle ':completion:*' menu select
|
|
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} ma=0\;33
|
|
|
|
# plugins
|
|
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
|
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
|
|
ZSH_AUTOSUGGEST_USE_ASYNC=1
|
|
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
|