我想我理解你的问题,我目前的设置可能类似:
为了在多台机器之间进行设置和同步,我已将所有点文件移至 Dropbox(在名为 .zsh 的文件夹中)。符号链接连接Dropbox/.zsh/.zshrc
到~/.zshrc
,并Dropbox/.zsh/.zshrc
获取我所有的各种配置文件,如下所示:
# Set so that all other sourced files can be found.
export ZDOTDIR="$HOME/Dropbox/.zsh"
source $ZDOTDIR/checks.zsh
# source $ZDOTDIR/colors.zsh
source $ZDOTDIR/exports.zsh
source $ZDOTDIR/oh-my-zsh_opts.zsh
source $ZDOTDIR/setopt.zsh
source $ZDOTDIR/pyopts.zsh
source $ZDOTDIR/prompt.zsh
source $ZDOTDIR/completion.zsh
source $ZDOTDIR/aliases.zsh
source $ZDOTDIR/bindkeys.zsh
source $ZDOTDIR/functions.zsh
# source $ZDOTDIR/zsh_hooks.zsh
同样,$ZDOTDIR/oh-my-zsh_opts.zsh
定义我所有的 Oh-my-zsh 选项:
# Path to your oh-my-zsh configuration.
ZSH=$ZDOTDIR/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# ZSH_THEME="af-magic"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(battery colored-man colorize cp extract frontend git pip python pyenv\
virtualenv)
if [[ $IS_MAC -eq 1 ]]; then
plugins=($plugins brew brew-cask osx textmate)
fi
if [[ $IS_LINUX -eq 1 ]]; then
plugins=($plugins)
fi
if [[ $HAS_APT -eq 1 ]]; then
plugins=($plugins debian)
fi
if [[ $HAS_YUM -eq 1 ]]; then
plugins=($plugins yum)
fi
source $ZSH/oh-my-zsh.sh