-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
86 lines (69 loc) · 2.36 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
source $HOME/.zshenv
# Completions
fpath=(/usr/local/share/zsh-completions $fpath)
# Autoload colors (for prompt)
autoload -U colors && colors
# Prompt theme
[ -f $HOME/.config/zsh/themes/prompt.zsh ] && source $HOME/.config/zsh/themes/prompt.zsh
# Auto/tab complete
autoload -U compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit
_comp_options+=(globdots)
# vi mode
bindkey -v
# export KEYTIMEOUT=1
# vi keys in tab complete menu
bindkey -M menuselect 'h' vi-backward-char
bindkey -M menuselect 'j' vi-down-line-or-history
bindkey -M menuselect 'k' vi-up-line-or-history
bindkey -M menuselect 'l' vi-forward-char
# ------------
# Source files
# ------------
# Aliases
[ -f "$HOME/.config/zsh/script/alias.sh" ] &&
source "$HOME/.config/zsh/script/alias.sh"
# Tmux projects
[ -f "$HOME/.config/tmux/aliases.sh" ] &&
source "$HOME/.config/tmux/aliases.sh"
# Z
[ -f "$HOME/.config/zsh/script/z.sh" ] &&
source "$HOME/.config/zsh/script/z.sh"
# macOS vs. Linux
if [[ $(uname) == "Darwin" ]]; then
ZSH_PLUGINS_DIR="/opt/homebrew/share"
elif [[ $(uname -n) == "lakka" ]]; then
ZSH_PLUGINS_DIR="$HOME/.local/share"
else
# i.e. Linux
ZSH_PLUGINS_DIR="/usr/share/zsh/plugins"
fi
# Syntax highlighting
[ -f "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ] &&
source "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
# Autosuggestions
[ -f "$ZSH_PLUGINS_DIR/zsh-autosuggestions/zsh-autosuggestions.zsh" ] &&
source "$ZSH_PLUGINS_DIR/zsh-autosuggestions/zsh-autosuggestions.zsh"
# Terminal true color test
[ -z "$TMUX" ] && [ -f $HOME/.config/zsh/script/truecolor-test.sh ] && $HOME/.config/zsh/script/truecolor-test.sh
# If not TMUX session and neofetch is installed, show system info
[ -z "$TMUX" ] && which neofetch 1>/dev/null 2>&1 && echo " " && neofetch
# Zoxide, if exists
if command -v zoxide &>/dev/null
then
mkdir -p "$HOME/.cache/zoxide"
_ZO_DATA_DIR="$HOME/.cache/zoxide"
_ZO_RESOLVE_SYMLINKS=1
eval "$(zoxide init zsh)"
fi
export PATH="/opt/homebrew/opt/openssl@3/bin:$PATH"
# fnm (node version manager)
[ -d "$HOME/.fnm" ] && export PATH="$HOME/.fnm:$PATH"
[ -d "$HOME/.local/share/fnm" ] && export PATH="$HOME/.local/share/fnm:$PATH"
if (which fnm 1>/dev/null 2>&1); then
eval "$(fnm env --use-on-cd)"
fi
# Add locally installed fzf to path - if found
[ -d "$HOME/.fzf/bin" ] && export PATH="$HOME/.fzf/bin:$PATH"