-
Notifications
You must be signed in to change notification settings - Fork 3
/
.zshrc
84 lines (67 loc) · 2.64 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
# Aliases
alias ls="ls -GlAhF"
# Show package.json scripts
scriptz () {
jq '.scripts' package.json
}
# Open Chrome with CORS disabled
no_cors_chrome() {
mkdir -p /tmp/nocorscanary
open /Applications/Google\ Chrome.app --args --user-data-dir="/tmp/nocorscanary" --disable-web-security --disable-site-isolation-trials
}
# Symlink gitconfig
ln -sf "$ZDOTDIR/.gitconfig" "$HOME/.gitconfig"
# History
export HISTFILE="$HOME/.zsh_history"
export HISTSIZE=10000
export SAVEHIST=$HISTSIZE
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_EXPIRE_DUPS_FIRST # Expire a duplicate event first when trimming history.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_FIND_NO_DUPS # Do not display a previously found event.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
setopt APPEND_HISTORY # append to history file
setopt HIST_NO_STORE # Don't store history commands
# Shell completions
autoload -Uz compinit && compinit -d "$HOME/.zcompdump" # Enable zsh completions
# Personal settings
PERSONAL="$ZDOTDIR/.personal"
if [ -f "$PERSONAL" ];
then
source "$PERSONAL"
else
echo "\nRecommendation: Create a personal file at $PERSONAL to contain any personal settings."
fi
# Personal Git Config
GITCONFIG_PERSONAL="$ZDOTDIR/.gitconfig.personal"
if [ -f "$GITCONFIG_PERSONAL" ];
then
ln -sf "$ZDOTDIR/.gitconfig.personal" "$HOME/.gitconfig.personal"
else
echo "\nRecommendation: Create a personal .gitconfig at $GITCONFIG_PERSONAL to contain any personal settings. Example contents:"
echo ""
echo " [user]"
echo " name = <github username>"
echo " email = <github email>"
fi
# Autosuggestions
AUTOSUGGESTIONS="$ZDOTDIR/../zsh-autosuggestions/zsh-autosuggestions.zsh"
if [ -f "$AUTOSUGGESTIONS" ];
then
export ZSH_AUTOSUGGEST_USE_ASYNC=true
source "$AUTOSUGGESTIONS"
else
echo "\nRecommendation: Install zsh-autosuggestions at $AUTOSUGGESTIONS"
fi
if [[ -x "$(command -v starship)" ]];
then
export STARSHIP_CONFIG="$ZDOTDIR/starship.toml"
eval "$(starship init zsh)"
else
echo "\nRecommendation: Install Starship"
fi