-
Notifications
You must be signed in to change notification settings - Fork 0
/
zshrc.default
83 lines (69 loc) · 3.97 KB
/
zshrc.default
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
#!/bin/zsh
#######################################################################
# SpaceZ Config Env #
#######################################################################
export SPACEZ_CONFIG_ZSH_ROOT_DIR="${SPACEZ_CONFIG_ZSH_ROOT_DIR:-${HOME}/SpaceZ/spacez_config_zsh}"
export SPACEZ_CONFIG_ZSH_OH_MY_ZSH_DIR="${SPACEZ_CONFIG_ZSH_OH_MY_ZSH_DIR:-${HOME}/.oh-my-zsh}"
export SPACEZ_CONFIG_ZSH_FZF_SHELL_DIR="${SPACEZ_CONFIG_ZSH_FZF_SHELL_DIR:-${HOME}/.fzf/shell}"
export SPACEZ_CONFIG_ZSH_PYENV_DIR="${SPACEZ_CONFIG_ZSH_PYENV_DIR:-${HOME}/.pyenv}"
export SPACEZ_CONFIG_ZSH_PROXY="${SPACEZ_CONFIG_ZSH_PROXY:-http://127.0.0.1:8080}"
export SPACEZ_CONFIG_ZSH_GOROOT="${SPACEZ_CONFIG_ZSH_GOROOT:-${HOME}/Code/Go/GoRoot}"
export SPACEZ_CONFIG_ZSH_GOPATH="${SPACEZ_CONFIG_ZSH_GOPATH:-${HOME}/Code/Go/GoPath}"
export SPACEZ_CONFIG_ZSH_GONOPROXY="${SPACEZ_CONFIG_ZSH_GONOPROXY:-}"
export SPACEZ_CONFIG_ZSH_GONOSUMDB="${SPACEZ_CONFIG_ZSH_GONOSUMDB:-}"
export SPACEZ_CONFIG_ZSH_GOPROXY="${SPACEZ_CONFIG_ZSH_GOPROXY:-https://goproxy.cn,direct}"
export SPACEZ_CONFIG_ZSH_GOPRIVATE="${SPACEZ_CONFIG_ZSH_GOPRIVATE:-}"
export SPACEZ_CONFIG_ZSH_GOSUMDB="${SPACEZ_CONFIG_ZSH_GOSUMDB:-sum.golang.google.cn}"
export SPACEZ_CONFIG_VIM_ROOT_DIR="${SPACEZ_CONFIG_VIM_ROOT_DIR:-${HOME}/SpaceZ/spacez_config_vim}"
export SPACEZ_CONFIG_VIM_PYTHON2_PATH="${SPACEZ_CONFIG_VIM_PYTHON2_PATH:-/usr/bin/python2}"
export SPACEZ_CONFIG_VIM_PYTHON3_PATH="${SPACEZ_CONFIG_VIM_PYTHON3_PATH:-/usr/bin/python3}"
export SPACEZ_CONFIG_VIM_FZF_PATH="${SPACEZ_CONFIG_VIM_FZF_PATH:-/usr/bin/local/fzf}"
export SPACEZ_CONFIG_VIM_ENABLE_PLUGINS="${SPACEZ_CONFIG_VIM_ENABLE_PLUGINS:-1}"
export SPACEZ_CONFIG_VIM_ENABLE_GUICOLORS="${SPACEZ_CONFIG_VIM_ENABLE_GUICOLORS:-1}"
export SPACEZ_CONFIG_VIM_GITHUB_MIRROR="${SPACEZ_CONFIG_VIM_GITHUB_MIRROR:-https://git::@github.com/%s.git}"
export SPACEZ_CONFIG_TMUX_ROOT_DIR="${SPACEZ_CONFIG_TMUX_ROOT_DIR:-${HOME}/SpaceZ/spacez_config_tmux}"
#######################################################################
# General #
#######################################################################
export PATH="${HOME}/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export ZSH="${SPACEZ_CONFIG_ZSH_OH_MY_ZSH_DIR}"
export ZSH_CACHE_DIR="${SPACEZ_CONFIG_ZSH_ROOT_DIR}/cache"
export MANPATH="/usr/local/man:${MANPATH}"
export LANG="en_US.UTF-8"
export EDITOR="vim"
#######################################################################
# oh-my-zsh #
#######################################################################
ZSH_THEME="afowler"
CASE_SENSITIVE="true"
HYPHEN_INSENSITIVE="true"
DISABLE_AUTO_UPDATE="true"
HIST_STAMPS="yyyy-mm-dd"
ZSH_CUSTOM="${SPACEZ_CONFIG_ZSH_ROOT_DIR}/custom"
plugins=(
zsh-completions # 命令补全
zsh-autosuggestions # 基于命令历史的自动提示
spacez_config_autosuggestions # 配置zsh-autosuggestions
colored-man-pages # 彩色的man page
extract # 使用"x"一键解压文件
z # 快速跳转到最匹配的目录
zsh_reload # 快速重载zsh配置
sudo # 用sudo重新执行命令
spacez_config_load
)
function add_to_plugin() {
if command -v $1 > /dev/null; then
plugins+=(${@:2})
fi
}
add_to_plugin pacman archlinux
add_to_plugin brew brew
add_to_plugin docker docker spacez_config_docker
add_to_plugin fzf spacez_config_fzf
add_to_plugin go spacez_config_golang
add_to_plugin tmux spacez_config_tmux
add_to_plugin git git gitignore
add_to_plugin nvim spacez_config_vim
source ${ZSH}/oh-my-zsh.sh
# 根据zsh-syntax-highlighting文档,这个插件必须在最后载入,所以不加入到plugins中,使用手动source
source ${SPACEZ_CONFIG_ZSH_ROOT_DIR}/custom/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh