forked from marlonrichert/zsh-snap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
105 lines (77 loc) · 3.25 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
##
# ⚠️ WARNING: Don't manually `source` your .zshrc file! This can have unexpected
# side effects.
# Instead, to apply changes, open a new terminal or restart your shell.
#
##
# Source Znap at the start of your .zshrc file.
#
source ~/git/zsh-snap/znap.zsh
##
# Does your shell feels slow to start? `znap prompt` reduces the time between
# opening your terminal and seeing your prompt to just 15 - 40 ms!
#
znap prompt agnoster/agnoster-zsh-theme
# `znap prompt` also supports Oh-My-Zsh themes. Just make sure you load the
# required libs first:
znap source ohmyzsh/ohmyzsh lib/{git,theme-and-appearance}
znap prompt ohmyzsh/ohmyzsh robbyrussell
# Using your own custom prompt? After initializing the prompt, just call
# `znap prompt` without arguments to get it to show:
PS1=$'%(?,%F{g},%F{r})%#%f '
znap prompt
# The same goes for any other kind of custom prompt:
znap eval starship 'starship init zsh --print-full-init'
znap prompt
# NOTE that `znap prompt` does not work with Powerlevel10k.
# With that theme, you should use its "instant prompt" feature instead.
##
# Load your plugins with `znap source`.
#
znap source marlonrichert/zsh-autocomplete
znap source marlonrichert/zsh-edit
# You can also choose to load one or more files specifically:
znap source sorin-ionescu/prezto modules/{environment,history}
znap source ohmyzsh/ohmyzsh \
'lib/(*~(git|theme-and-appearance).zsh)' plugins/git
# No special syntax is needed to configure plugins. Just use normal Zsh
# statements:
znap source marlonrichert/zsh-hist
bindkey '^[q' push-line-or-edit
bindkey -r '^Q' '^[Q'
ZSH_AUTOSUGGEST_STRATEGY=( history )
znap source zsh-users/zsh-autosuggestions
ZSH_HIGHLIGHT_HIGHLIGHTERS=( main brackets )
znap source zsh-users/zsh-syntax-highlighting
##
# Cache the output of slow commands with `znap eval`.
#
# If the first arg is a repo, then the command will run inside it. Plus,
# whenever you update a repo with `znap pull`, its eval cache gets regenerated
# automatically.
znap eval trapd00r/LS_COLORS "$( whence -a dircolors gdircolors ) -b LS_COLORS"
# The cache gets regenerated, too, when the eval command has changed. For
# example, here we include a variable. So, the cache gets invalidated whenever
# this variable has changed.
znap source marlonrichert/zcolors
znap eval marlonrichert/zcolors "zcolors ${(q)LS_COLORS}"
# Combine `znap eval` with `curl` or `wget` to download, cache and source
# individual files:
znap eval omz-git 'curl -fsSL \
https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/git/git.plugin.zsh'
##
# Defer initilization code with lazily loaded functions created by
# `znap function`.
#
# For each of the examples below, the `eval` statement on the right is not
# executed until you try to execute the associated command or try to use
# completion on it.
znap function _pyenv pyenv 'eval "$( pyenv init - --no-rehash )"'
compctl -K _pyenv pyenv
znap function _pip_completion pip 'eval "$( pip completion --zsh )"'
compctl -K _pip_completion pip
znap function _python_argcomplete pipx 'eval "$( register-python-argcomplete pipx )"'
complete -o nospace -o default -o bashdefault \
-F _python_argcomplete pipx
znap function _pipenv pipenv 'eval "$( pipenv --completion )"'
compdef _pipenv pipenv