Clean up vim-settings install

This commit is contained in:
ViViDboarder 2015-06-03 13:57:19 -07:00
parent f4d7fa908e
commit ef487389e5
3 changed files with 8 additions and 101 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "assets/default/vim-settings"]
path = assets/default/vim-settings
url = https://github.com/ViViDboarder/vim-settings.git

@ -1 +0,0 @@
Subproject commit 270f8f929b30e2763686f3bf68e2a3df5ef176d4

View File

@ -1,101 +1,12 @@
#! /bin/bash #! /bin/bash
VIM_SETTINGS_DIR=$WORKSPACE/vim-settings
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
# Clone vundle if not done already # Clone vundle if not done already
if [ ! -d ~/.vim/bundle/vundle ]; then if [ ! -d $VIM_SETTINGS_DIR ]; then
log "Installing vundle" log "Cloning vim-settings"
mkdir -p ~/.vim/bundle git clone https://github.com/ViViDboarder/vim-settings $VIM_SETTINGS_DIR
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle (cd $VIM_SETTINGS_DIR && ./vim-sync-append.sh)
fi else
log "Updating vim-settings"
# Make backup and tmp dirs (cd $VIM_SETTINGS_DIR && git pull)
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
fi fi