-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.zshrc
98 lines (77 loc) · 2.95 KB
/
.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# history
HISTFILE="$HOME/.zhistory"
HISTSIZE=50000
SAVEHIST=10000
setopt extended_history # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups # ignore duplicated commands history list
setopt hist_ignore_space # ignore commands that start with space
setopt hist_verify # show command with history expansion to user before running it
setopt inc_append_history # add commands to HISTFILE in order of execution
setopt share_history # share command history data
# completion
zstyle ':completion:*' rehash true
zstyle ':completion:*' menu select
zstyle :compinstall filename "$HOME/.zshrc"
autoload -Uz compinit
compinit
setopt complete_aliases
# install zplug
if [[ ! -f ~/.zplug/init.zsh ]]; then
curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh
fi
source ~/.zplug/init.zsh
zplug 'zplug/zplug', hook-build:'zplug --self-manage'
zplug "romkatv/powerlevel10k", as:theme, depth:1
zplug "zsh-users/zsh-autosuggestions"
zplug "zsh-users/zsh-completions"
zplug "zsh-users/zsh-history-substring-search"
zplug "zsh-users/zsh-syntax-highlighting", defer:2
zplug "plugins/extract", from:oh-my-zsh
zplug "plugins/git", from:oh-my-zsh
zplug "plugins/sudo", from:oh-my-zsh
zplug "plugins/colored-man-pages", from:oh-my-zsh
zplug "b4b4r07/enhancd"
zplug "supercrabtree/k"
zplug "MichaelAquilina/zsh-autoswitch-virtualenv"
zplug "junegunn/fzf", \
hook-build:"./install --bin && ln -fsr bin/fzf $ZPLUG_HOME/bin", \
use:"shell/*.zsh"
zplug "~/.zsh", from:local
# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
echo; zplug install
fi
fi
zplug load
# keybinds
bindkey -v
bindkey "^A" vi-beginning-of-line
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
bindkey '^[[3~' delete-char
bindkey '^[3;5~' delete-char
bindkey '\e[3~' delete-char
bindkey -r '^[' # Alt+key does not trigger vi-cmd-mode anymore
# powerlevel10k instant prompt
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# eval dircolors
[[ -f $HOME/.dircolors ]] && eval "$(dircolors "$HOME/.dircolors")"
# highlighting
[[ -f $HOME/.highlight.zsh ]] && source "$HOME/.highlight.zsh"
# aliases
[[ -f $HOME/.alias ]] && source $HOME/.alias
# load powerlevel10k
if zmodload zsh/terminfo && (( terminfo[colors] >= 256 )); then
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
else
[[ ! -f ~/.zsh/p10k-console.zsh ]] || source ~/.zsh/p10k-console.zsh
fi
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS+=singularity_venv
POWERLEVEL9K_SINGULARITY_VENV_BACKGROUND=blue