feat: zshrc updates

* zplug-managed zplug
* zplug load defers
* spaceship prompt items explicit definition
* spaceship prompt color change
* ohmyzsh update time change
* specify histcontrol format
* add asdf - the extendable version manager
* add exa --> ls alias
This commit is contained in:
surtur 2020-10-05 18:36:42 +02:00
parent fc63939552
commit d2a75221e8
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

38
zshrc
View File

@ -1,14 +1,16 @@
# If you come from bash you might have to change your $PATH.
source ~/.zplug/init.zsh
zplug "denysdovhan/spaceship-prompt", use:spaceship.zsh, from:github, as:theme
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-autosuggestions", defer:2
#zplug "zsh-users/zsh-syntax-highlighting"
zplug "zdharma/fast-syntax-highlighting"
zplug "zsh-users/zsh-history-substring-search"
zplug "zdharma/fast-syntax-highlighting", defer:2
zplug "zsh-users/zsh-history-substring-search", defer:2
zplug "plugins/git", from:oh-my-zsh, defer:2
zplug "plugins/gitignore", from:oh-my-zsh, defer:2
zplug "plugins/systemd", from:oh-my-zsh, defer:2
zplug "plugins/dnf", from:oh-my-zsh, defer:2
# zplug "arzzen/calc.plugin.zsh", defer:2
zplug 'zplug/zplug', hook-build:'zplug --self-manage'
# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
@ -17,7 +19,7 @@
echo; zplug install
fi
fi
# zplug load
source ~/.zplug/repos/zsh-users/zsh-autosuggestions/zsh-autosuggestions.zsh
#source ~/.zplug/repos/zsh-users/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.zplug/repos/zdharma/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
@ -26,8 +28,10 @@
source ~/.zplug/repos/robbyrussell/oh-my-zsh/plugins/gitignore/gitignore.plugin.zsh
source ~/.zplug/repos/robbyrussell/oh-my-zsh/plugins/systemd/systemd.plugin.zsh
source ~/.zplug/repos/robbyrussell/oh-my-zsh/plugins/dnf/dnf.plugin.zsh
#source ~/.zplug/repos/arzzen/calc.plugin.zsh/calc.plugin.zsh
ZSH_THEME="spaceship"
SPACESHIP_PROMPT_ORDER=(time user dir host git package node ruby golang php rust haskell docker venv pyenv dotnet exec_time line_sep battery jobs exit_code char)
SPACESHIP_PROMPT_ADD_NEWLINE=false
SPACESHIP_PROMPT_SEPARATE_LINE=true
@ -43,7 +47,7 @@
SPACESHIP_BATTERY_SHOW=true
SPACESHIP_BATTERY_THRESHOLD=35
#SPACESHIP_CHAR_SYMBOL=\>
SPACESHIP_CHAR_COLOR_SUCCESS=blue
SPACESHIP_CHAR_COLOR_SUCCESS=green
#SPACESHIP_CHAR_SUFFIX=""
# Path to your oh-my-zsh installation.
@ -65,16 +69,18 @@
DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
export UPDATE_ZSH_DAYS=1
export UPDATE_ZSH_DAYS=3
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
DISABLE_MAGIC_FUNCTIONS=false
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
ENABLE_CORRECTION="false"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
@ -87,12 +93,13 @@
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
HIST_STAMPS="dd.mm.yyyy"
export HIST_STAMPS="dd.mm.yyyy"
setopt share_history
setopt hist_ignore_dups
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_space
export HISTCONTROL=ignoredups:erasedups
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
@ -119,7 +126,14 @@
export FZF_DEFAULT_COMMAND="fzf --preview 'head -100 {}'"
# User configuration
export PATH="$HOME/.local/bin:$HOME/utils/bin:$HOME/.cargo/bin:$PATH"
source ~/.asdf/asdf.sh
# append completions to fpath
fpath=(${ASDF_DIR}/completions $fpath)
# initialise completions with ZSH's compinit
autoload -Uz compinit
compinit
source ~/.dotenv
export PATH="$HOME/.local/bin:$HOME/utils/bin:$HOME/.cargo/bin:$GOPATH/bin:$PATH"
# You may need to manually set your language environment
export LANG=en_GB.UTF-8
@ -130,9 +144,7 @@
eval `ssh-agent` > /dev/null
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
ssh-add -l > /dev/null || ssh-add > /dev/null
if [ -n "$DESKTOP_SESSION" ];then
eval $(gnome-keyring-daemon --start)
@ -146,10 +158,8 @@
export kee="surtur"
export SSH_KEY_PATH="~/.ssh/$kee"
source ~/.dotenv
eval $(TERM=xterm-256color dircolors)
alias ls='ls --color=auto'
alias ls='exa'
alias ls='exa -al --group-directories-first'
alias grubup='sudo grub2-mkconfig -o /boot/grub2/grub.cfg'
alias am='sudo -i'
alias mv='mv -i'