From ef487389e5b97655a623f74747e3ad0dee7f6698 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Wed, 3 Jun 2015 13:57:19 -0700 Subject: [PATCH] Clean up vim-settings install --- .gitmodules | 3 - assets/default/vim-settings | 1 - recipes/default/vim-settings | 105 +++-------------------------------- 3 files changed, 8 insertions(+), 101 deletions(-) delete mode 100644 .gitmodules delete mode 160000 assets/default/vim-settings diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 8fce0e1..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "assets/default/vim-settings"] - path = assets/default/vim-settings - url = https://github.com/ViViDboarder/vim-settings.git diff --git a/assets/default/vim-settings b/assets/default/vim-settings deleted file mode 160000 index 270f8f9..0000000 --- a/assets/default/vim-settings +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 270f8f929b30e2763686f3bf68e2a3df5ef176d4 diff --git a/recipes/default/vim-settings b/recipes/default/vim-settings index 2e97ed1..2615785 100644 --- a/recipes/default/vim-settings +++ b/recipes/default/vim-settings @@ -1,101 +1,12 @@ #! /bin/bash - -DET_OS="unknown" -UNAME_STR=`uname` - -# Some settings are mac specific -if [[ "$UNAME_STR" == "Darwin" ]]; then - DET_OS="mac" -elif [[ "$UNAME_STR" == "Linux" ]]; then - DET_OS="linux" -fi +VIM_SETTINGS_DIR=$WORKSPACE/vim-settings # Clone vundle if not done already -if [ ! -d ~/.vim/bundle/vundle ]; then - log "Installing vundle" - mkdir -p ~/.vim/bundle - git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle -fi - -# Make backup and tmp dirs -log "Building temp and backup dirs" -mkdir -p ~/.vim/backup -mkdir -p ~/.vim/tmp -mkdir -p ~/.vim/doc - -log "Link vim files" -try_link vimrc "$HOME/.vimrc_sync" -try_link vim "$HOME/.vim_sync" - -if [[ ( ! -f ~/.vimrc ) ]]; then - log "No ~/.vimrc found, creating one" - touch ~/.vimrc -fi - -# Source synced setting in vimrc -add_line '"import vimrc from synced' $HOME/.vimrc -add_line 'source ~/.vimrc_sync' $HOME/.vimrc - -add_line '"add vim directory from synced' ~/.vimrc -add_line 'set runtimepath+=$HOME/.vim_sync' ~/.vimrc - -log "Install all bundles" -vim +BundleInstall! +qall - -###### Possibly depreciate this section when using plug or neobundle - -# Compile CommandT if possible -# See if ruby is installed -if command -v ruby >/dev/null 2>&1; then - # Make sure GCC is installed - if command -v gcc >/dev/null 2>&1; then - # Use system ruby - command -v rvm >/dev/null 2>&1 && { rvm use system; } - log "Compile Command T's C extension" - cd ~/.vim/bundle/Command-T/ruby/command-t - ruby extconf.rb - make - fi -fi - -# Display warning methods related to Command T -vim --version | grep -q '\+ruby' || { log "Warning: Default vim does not include ruby as needed for Command T"; } -command -v ruby >/dev/null 2>&1 || { log "Warning: ruby required for Command T"; } -command -v gcc >/dev/null 2>&1 || { log "Warning: gcc required for Command T"; } - -# Execute vim's update of the helptags -VIM_RESULT=$(vim +"helptags ~/.vim/doc" +"q") - -if [[ "$VIM_RESULT" == *SEGV* ]]; then - log "Seg Faulted. Retry with different ruby" - cd ~/.vim/bundle/Command-T/ruby/command-t && /opt/local/bin/ruby* extconf.rb && make && cd - - - # Retry - vim +"helptags ~/.vim/doc" +"q" -fi - -# End command t - -log "Compile vimproc" -cd ~/.vim/bundle/vimproc.vim && make -cd - - -###### End compile plugins - -log "Install Powerline Fonts" -# Install Powerline Fonts -pf_dir="$workspace/powerline-fonts" -git clone https://github.com/Lokaltog/powerline-fonts $pf_dir - -# Setup vim-powerline with patched fonts -if [[ "$DET_OS" == "mac" ]]; then - #Install DejaVu - cp $pf_dir/DejaVuSansMono/*.ttf ~/Library/Fonts/ -elif [[ "$DET_OS" == "linux" ]]; then - #Install DejaVu - cp -r $pf_dir/DejaVuSansMono ~/.fonts/ - cp -r $pf_dir/UbuntuMono ~/.fonts/ - cp -r $pf_dir/SourceCodePro ~/.fonts/ - # Refresh cache - fc-cache -vf +if [ ! -d $VIM_SETTINGS_DIR ]; then + log "Cloning vim-settings" + git clone https://github.com/ViViDboarder/vim-settings $VIM_SETTINGS_DIR + (cd $VIM_SETTINGS_DIR && ./vim-sync-append.sh) +else + log "Updating vim-settings" + (cd $VIM_SETTINGS_DIR && git pull) fi