Clone Vim bundles into vim/bundles
Instead of using submodules, I'm having the setup script clone each bundle into its own directory in vim/bundle. The dotfiles repo has a .gitignore file in that directory which will ensure the directory exists, but nothing in it is tracked.
This commit is contained in:
		
							parent
							
								
									fa57bf9fcb
								
							
						
					
					
						commit
						70be386c85
					
				
					 1 changed files with 44 additions and 5 deletions
				
			
		
							
								
								
									
										49
									
								
								setup.sh
									
										
									
									
									
								
							
							
						
						
									
										49
									
								
								setup.sh
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -3,6 +3,21 @@
 | 
			
		|||
dfdir=$(cd "$(dirname "$0")" && pwd)
 | 
			
		||||
sys=`uname -s | tr A-Z a-z`
 | 
			
		||||
 | 
			
		||||
# Vim bundles
 | 
			
		||||
typeset -A vimbundles
 | 
			
		||||
vimbundles=( \
 | 
			
		||||
    blackboard "https://github.com/nelstrom/vim-blackboard.git" \
 | 
			
		||||
    command-t "https://github.com/wincent/Command-T.git" \
 | 
			
		||||
    fugitive "https://github.com/tpope/vim-fugitive.git" \
 | 
			
		||||
    gundo "https://github.com/sjl/gundo.vim.git" \
 | 
			
		||||
    repeat "https://github.com/tpope/vim-repeat" \
 | 
			
		||||
    snipmate "https://github.com/msanders/snipmate.vim.git" \
 | 
			
		||||
    solarized "https://github.com/altercation/vim-colors-solarized.git" \
 | 
			
		||||
    speeddating "https://github.com/tpope/vim-speeddating.git" \
 | 
			
		||||
    surround "https://github.com/tpope/vim-surround.git" \
 | 
			
		||||
    unimpaired "https://github.com/tpope/vim-unimpaired.git" \
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
print -P "%BSymlinking config files%b"
 | 
			
		||||
for dotfile in `ls $dfdir`
 | 
			
		||||
do
 | 
			
		||||
| 
						 | 
				
			
			@ -20,7 +35,7 @@ do
 | 
			
		|||
    fi
 | 
			
		||||
    filler=$(($COLUMNS - ${#dest} - ${#action} - 4))
 | 
			
		||||
    spaces=''
 | 
			
		||||
    for (( i=0; $i < $filler; i++ )); do spaces="$spaces " done
 | 
			
		||||
    for (( i=0; $i < $filler; i++ )); do spaces="$spaces "; done
 | 
			
		||||
 | 
			
		||||
    echo -n "  $dest$spaces"
 | 
			
		||||
    if [[ $action = 'linked' ]]; then
 | 
			
		||||
| 
						 | 
				
			
			@ -36,9 +51,33 @@ echo "touch $HOME/.hushlogin"
 | 
			
		|||
touch "$HOME/.hushlogin"
 | 
			
		||||
 | 
			
		||||
# Initialize submodules
 | 
			
		||||
print -P "%BInitializing git submodules%b"
 | 
			
		||||
cd "$dfdir"
 | 
			
		||||
git submodule init
 | 
			
		||||
git submodule update
 | 
			
		||||
print -P "%BFetching Vim modules%b"
 | 
			
		||||
cd "$dfdir/vim/bundle"
 | 
			
		||||
for module in ${(k)vimbundles}; do
 | 
			
		||||
    echo -n "  $module"
 | 
			
		||||
 | 
			
		||||
    if [ -d $module ]; then
 | 
			
		||||
        result='skipped'
 | 
			
		||||
    else
 | 
			
		||||
        git clone ${vimbundles[$module]} $module 1>/dev/null 2>&1
 | 
			
		||||
        if [[ $? -eq 0 ]]; then
 | 
			
		||||
            result='done'
 | 
			
		||||
        else
 | 
			
		||||
            result='failed'
 | 
			
		||||
        fi
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    spaces=''
 | 
			
		||||
    filler=$(($COLUMNS - ${#module} - ${#result} - 4))
 | 
			
		||||
    for (( i=0; $i < $filler; i++ )); do spaces="$spaces "; done
 | 
			
		||||
    if [[ $result == 'skipped' ]]; then
 | 
			
		||||
        color='yellow'
 | 
			
		||||
    elif [[ $result == 'failed' ]]; then
 | 
			
		||||
        color='red'
 | 
			
		||||
    elif [[ $result == 'done' ]]; then
 | 
			
		||||
        color='green'
 | 
			
		||||
    fi
 | 
			
		||||
    print -P "$spaces%F{$color}$result%f"
 | 
			
		||||
done
 | 
			
		||||
 | 
			
		||||
exit 0
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue