-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_zshrc
67 lines (54 loc) · 2.28 KB
/
dot_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
#!/usr/bin/env zsh
# Attach to an existing tmux session or create a new one
[ -z "$TMUX" ] && exec tmux new -As main
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
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
# Load environment variables
[ -f ~/.envrc ] && source ~/.envrc
# Load aliases
[ -f ~/.aliasesrc ] && source ~/.aliasesrc
[ -f ~/.private_aliasesrc ] && source ~/.private_aliasesrc
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# ZSH plugins
source $(brew --prefix)/opt/zsh-vi-mode/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $(brew --prefix)/share/zsh-history-substring-search/zsh-history-substring-search.zsh
source $(brew --prefix)/share/powerlevel10k/powerlevel10k.zsh-theme
source $(brew --prefix asdf)/libexec/asdf.sh
source $HOME/.asdf/plugins/golang/set-env.zsh
# Completions folder
mkdir -p $HOME/.zsh_completions
FPATH=$HOME/.zsh_completions:$FPATH
# zsh-completions plugin
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
autoload -Uz compinit
compinit
fi
# History
HISTSIZE=10000
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HISTDUP=erase
setopt appendhistory
setopt sharehistory
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups
# Key bindings for history-substring-search plugin
bindkey '^p' history-substring-search-up
bindkey '^n' history-substring-search-down
# Key bindings for zsh-autosuggestions plugin
bindkey '^e' autosuggest-accept # Accepts the current suggestion.
bindkey '^f' forward-word # Accepts the next part of the suggestion.
# Completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' # Case-insensitive tab completion.
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # Make tab completion colorful.