-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathzshrc
More file actions
69 lines (55 loc) · 1.76 KB
/
zshrc
File metadata and controls
69 lines (55 loc) · 1.76 KB
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
# Stash your environment variables in ~/.localrc. This means they'll stay out
# of your main dotfiles repository (which may be public, like this one), but
# you'll have access to them in your scripts.
if [[ -a $HOME/.localrc ]]
then
source $HOME/.localrc
fi
source $HOME/.aliases
# add PATH to binaries
export PATH="$PATH:$HOME/.bin"
# all of our zsh files
typeset -U config_files
config_files=($HOME/.zsh/*.zsh)
# load the path files
for file in ${(M)config_files:#*/path.zsh}
do
source $file
done
# load everything but the path and completion files
for file in ${${config_files:#*/path.zsh}:#*/completion.zsh}
do
source $file
done
# initialize autocomplete here, otherwise functions won't be loaded
autoload -U compinit
compinit
# load every completion after autocomplete loads
for file in ${(M)config_files:#*/completion.zsh}
do
source $file
done
unset config_files
# Restore emacs key behavior (ctrl+a to move the caret to the begining of the line for example)
bindkey -e
# Better history
# Credits to https://coderwall.com/p/jpj_6q/zsh-better-history-searching-with-arrow-keys
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "${terminfo[kcuu1]}" up-line-or-beginning-search # Up
bindkey "${terminfo[kcud1]}" down-line-or-beginning-search # Down
# Search history
stty -ixon
# ZSH uses compinit to initialize completion for the current session.
# To speed up the running of compinit, it can be made to produce a
# dumped configuration which will be read in on future invocations.
rm -rf $HOME/.zcompdump*
# pnpm
export PNPM_HOME="/home/dulacp/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end