-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc_defaults
85 lines (64 loc) · 2.1 KB
/
zshrc_defaults
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
if [[ $TERM_PROGRAM != "Apple_Terminal" ]]; then
# Apple's Terminal has own setup and integrations
HISTFILE=$HOME/.zsh_history
HISTSIZE=2000
SAVEHIST=1000
# use wezterm's shell integrations
if [ -d /Applicatons/Wezterm.app ]; then
. /Applications/WezTerm.app/Contents/Resources/wezterm.sh
fi
fi
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
fi
fpath+=~/.zfunc
# The following lines were added by compinstall
zstyle ':completion:*' completer _expand _complete _ignored _approximate
zstyle :compinstall filename '~/.zshrc'
autoload -Uz compinit
compinit -C
# End of lines added by compinstall
export DOTFILES=~/.dotfiles
# gets plugins sourced by sheldon
export SHELDON_CONFIG_FILE="$DOTFILES/zsh_plugins.toml"
eval "$(sheldon source)"
# setup fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s $NVM_DIR/nvm.sh ] && \. $NVM_DIR/nvm.sh --no-use # This loads nvm
[[ -r $NVM_DIR/bash_completion ]] && \. $NVM_DIR/bash_completion # load nvm completions
PATH="/Users/ross/Library/Python/3.9/bin:$PATH"
eval "$(starship init zsh)"
eval "$(zoxide init zsh)"
function sync_system_theme() {
SYSTEM_THEME="$(defaults read -globalDomain AppleInterfaceStyle 2>/dev/null || [ $(uname) = "Darwin" ] && echo 'Light' || echo 'Dark')"
if [ "$THEME" != "$SYSTEM_THEME" ]; then
export THEME=$SYSTEM_THEME
source $DOTFILES/switch_theme $SYSTEM_THEME
fi
}
preexec_functions=(sync_system_theme)
# sets terminal theme to system theme mode
sync_system_theme
# sets terminal tab title to cwd
cwd_as_title() {
printf "\e]1;${$(dirs):t3}\a"
}
run_nvm_use() {
if [ -f ./package.json ]; then
if [ -f ./.nvmrc ]; then
nvm use
else
nvm use --lts
fi
fi
}
cwd_as_title
run_nvm_use
chpwd_functions+=(cwd_as_title run_nvm_use)
export PATH="$DOTFILES/bin:$PATH"
export MANPAGER="zsh -c 'col -bx | bat -l man -p'"
#aliases
alias ls='lsd'
alias vi='nvim'
alias upgrade-wezterm="brew upgrade --cask wezterm-nightly --no-quarantine --greedy-latest"