From fa75e2c6b7068421ad50de9ad32f459136627b9f Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sat, 12 Sep 2015 00:58:56 +0000 Subject: [PATCH] Big update Moved stuff into a home directory to seperate it out. Changed the names of the dotfiles to re-include the dot at the start of their name. Moved the scripts into an appropriate folder and updated the bootstrap script to be more agnostic about where thigs are located. Finally updated the submodule locations --- .gitmodules | 16 ++++++++-------- gitconfig => home/.gitconfig | 0 {.vim => home/.vim}/bundle/nerdtree | 0 {.vim => home/.vim}/bundle/rust.vim | 0 {.vim => home/.vim}/bundle/vim-markdown | 0 {.vim => home/.vim}/bundle/vimoutliner | 0 vimrc => home/.vimrc | 0 zshrc => home/.zshrc | 0 bootstrap.sh => scripts/bootstrap.sh | 24 +++++++++++++++++------- scripts/installers/README | 1 + 10 files changed, 26 insertions(+), 15 deletions(-) rename gitconfig => home/.gitconfig (100%) rename {.vim => home/.vim}/bundle/nerdtree (100%) rename {.vim => home/.vim}/bundle/rust.vim (100%) rename {.vim => home/.vim}/bundle/vim-markdown (100%) rename {.vim => home/.vim}/bundle/vimoutliner (100%) rename vimrc => home/.vimrc (100%) rename zshrc => home/.zshrc (100%) rename bootstrap.sh => scripts/bootstrap.sh (74%) create mode 100644 scripts/installers/README diff --git a/.gitmodules b/.gitmodules index 65bb00d..8bd5027 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,12 @@ -[submodule ".vim/bundle/nerdtree"] - path = .vim/bundle/nerdtree +[submodule "home/.vim/bundle/nerdtree"] + path = home/.vim/bundle/nerdtree url = https://github.com/scrooloose/nerdtree.git -[submodule ".vim/bundle/rust.vim"] - path = .vim/bundle/rust.vim +[submodule "home/.vim/bundle/rust.vim"] + path = home/.vim/bundle/rust.vim url = https://github.com/rust-lang/rust.vim.git -[submodule ".vim/bundle/vim-markdown"] - path = .vim/bundle/vim-markdown +[submodule "home/.vim/bundle/vim-markdown"] + path = home/.vim/bundle/vim-markdown url = https://github.com/plasticboy/vim-markdown.git -[submodule ".vim/bundle/vimoutliner"] - path = .vim/bundle/vimoutliner +[submodule "home/.vim/bundle/vimoutliner"] + path = home/.vim/bundle/vimoutliner url = https://github.com/vimoutliner/vimoutliner.git diff --git a/gitconfig b/home/.gitconfig similarity index 100% rename from gitconfig rename to home/.gitconfig diff --git a/.vim/bundle/nerdtree b/home/.vim/bundle/nerdtree similarity index 100% rename from .vim/bundle/nerdtree rename to home/.vim/bundle/nerdtree diff --git a/.vim/bundle/rust.vim b/home/.vim/bundle/rust.vim similarity index 100% rename from .vim/bundle/rust.vim rename to home/.vim/bundle/rust.vim diff --git a/.vim/bundle/vim-markdown b/home/.vim/bundle/vim-markdown similarity index 100% rename from .vim/bundle/vim-markdown rename to home/.vim/bundle/vim-markdown diff --git a/.vim/bundle/vimoutliner b/home/.vim/bundle/vimoutliner similarity index 100% rename from .vim/bundle/vimoutliner rename to home/.vim/bundle/vimoutliner diff --git a/vimrc b/home/.vimrc similarity index 100% rename from vimrc rename to home/.vimrc diff --git a/zshrc b/home/.zshrc similarity index 100% rename from zshrc rename to home/.zshrc diff --git a/bootstrap.sh b/scripts/bootstrap.sh similarity index 74% rename from bootstrap.sh rename to scripts/bootstrap.sh index 2a5a380..2e4bd8e 100755 --- a/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -16,7 +16,7 @@ link() { cp "$1/$2" "$1/$2.old" echo "Backed up original $2 to $1/$2.old" fi - ln -sf "$PWD/$3" "$1/$2" + ln -sf "$3" "$1/$2" } link_dir() { @@ -36,8 +36,15 @@ link_dir() { set -x set -e +# Step out of the script directory and into the main dotfiles directory +cd .. + +# Store the path to the root directory and the reference home directory +DOTFILES_DIR="$PWD" +DOTFILES_HOME="$DOTFILES_DIR/home" + # Configure .vimrc -link "$HOME" ".vimrc" "vimrc" +link "$HOME" ".vimrc" "$DOTFILES_HOME/.vimrc" # Download pathogen if it doesn't exist already VIM_AUTOLOAD=$HOME/.vim/autoload @@ -48,21 +55,24 @@ fi # Configure Pathogen Plugins VIM_BUNDLE=$HOME/.vim/bundle +# Make the bundle directory and it's parents if they don't exist mkdir -p $VIM_BUNDLE -plugins=($(ls -d $PWD/.vim/bundle/* | tr -s ' ')) -echo "${plugins[@]}" +# A list of vim plugins that are submodules +plugins=($(ls -d $DOTFILES_HOME/.vim/bundle/* | tr -s ' ')) +#echo "${plugins[@]}" +# Loop through all of the plugins and install them as links in the bundle directory for plugin in ${plugins[@]}; do parts=($(echo "$plugin" | tr '/' ' ')) plugin_name=${parts[-1]} - echo "$VIM_BUNDLE $plugin_name $plugin" + #echo "$VIM_BUNDLE $plugin_name $plugin" link_dir $VIM_BUNDLE $plugin_name $plugin done # Configure .gitconfig -link "$HOME" ".gitconfig" "gitconfig" +link "$HOME" ".gitconfig" "$DOTFILES_HOME/.gitconfig" # Configure .zshrc -link "$HOME" ".zshrc" "zshrc" +link "$HOME" ".zshrc" "$DOTFILES_HOME/.zshrc" # Create an auto updater for the dotfiles if [ ! -f "$HOME/.update_dotfiles.sh" ]; then diff --git a/scripts/installers/README b/scripts/installers/README new file mode 100644 index 0000000..17d6a7b --- /dev/null +++ b/scripts/installers/README @@ -0,0 +1 @@ +The scripts in this directory are for configuring my new systems to a specific baseline state.