-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
109 lines (89 loc) · 3.13 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
99
100
101
102
103
104
105
106
107
108
109
### Editors
export EDITOR='vim'
export VISUAL='vim'
export PAGER='less'
# Language
export LANG='de_DE.UTF-8'
# Add additional directories to load prezto modules from
zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib
# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'evalcache' \
'history' \
'autosuggestions' \
'archive' \
'prompt' \
'completion' \
'fzf-tab' \
'directory' \
'docker' \
'syntax-highlighting' \
'history-substring-search' \
'history-search-multi-word' \
'pyenv-lazy' \
# 'terminal' \
# fallback for ARM systems - for now ..
zstyle ':prezto:module:prompt' theme 'minimal'
zstyle ':prezto:module:prompt' show-return-val 'no'
# Set the command prefix on non-GNU systems.
# zstyle ':prezto:module:gnu-utility' prefix 'g'
# init homebrew for apple silicon - needed for direnv
# needs to happen before plugin loading, so that pyenv pip comes first in PATH
[ -f "/opt/homebrew/bin/brew" ] && eval "$(/opt/homebrew/bin/brew shellenv)"
# put this dir before homebrew bin in the path to ensure using the right node app
path /usr/local/bin
### Syntax Highlighting
zstyle ':prezto:module:syntax-highlighting' highlighters \
'main' \
'brackets' \
'pattern'
# Set syntax highlighting styles.
zstyle ':prezto:module:syntax-highlighting' styles \
'path' 'fg=cyan'
# Set syntax pattern styles.
zstyle ':prezto:module:syntax-highlighting' pattern \
'rm*-rf*' 'fg=white,bold,bg=red'
# HISTORY SEARCH OPTIONS
zstyle ":history-search-multi-word" highlight-color "fg=white,bg=yellow"
zstyle ":plugin:history-search-multi-word" synhl "yes" # Whether to perform syntax highlighting (default true)
zstyle ":plugin:history-search-multi-word" active "bg=59"
COMPLETION_WAITING_DOTS="true"
zstyle ':completion:*' special-dirs true
# Source Prezto
source "$HOME/.zprezto/init.zsh"
## unset preztos annoying grouping feature
zstyle ':completion:*' format ' -- %d --'
#### Tmux
## Auto start a session when Zsh is launched in a local terminal.
#zstyle ':prezto:module:tmux:auto-start' local 'no'
## Auto start a session when Zsh is launched in a SSH connection.
#zstyle ':prezto:module:tmux:auto-start' remote 'no'
# initialize direnv
(( $+commands[direnv] )) 2>&1 && _evalcache direnv hook zsh
[[ -f ~/.fzf.zsh ]] && source ~/.fzf.zsh
_evalcache fasd --init auto # 35ms :(
# load aliases and the prompt
source ~/.alias
(( $+commands[starship] )) && _evalcache starship init zsh
upify() {
buf="$(echo "${BUFFER}" | sed 's/[ |]*$//')"
tmp="$(mktemp)"
eval "${buf} |& up --unsafe-full-throttle -o '$tmp' 2>/dev/null"
cmd="$(tail -n +2 "$tmp")"
rm -f "$tmp"
BUFFER="${BUFFER} | ${cmd}"
zle end-of-line
}
zle -N upify
# use Ctrl+P to invoke and Ctrl+X to close and use the result
bindkey '^P' upify
PROMPT_EOL_MARK=⏎
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && source ~/.nvm/nvm.sh # This loads nvm
# Setting fd as the default source for fzf
(( $+commands[fd] )) && export FZF_DEFAULT_COMMAND='fd --type f'
# misc
export PYTHONBREAKPOINT=ipdb.set_trace