Improve vim sync script

This commit is contained in:
Michael Campagnaro 2020-01-06 13:05:39 -05:00
parent 869762c9ae
commit f0d80c41d6
3 changed files with 32 additions and 11 deletions

16
bin/pull-vim Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Copies vim data from the home directory to the dotfiles repo.
set -e
src="$HOME/.vim"
dest="$HOME/.dotfiles/vim/"
if [ -d $src ]; then
[ -d "$src/spell" ] && echo "Syncing user dictionary" && cp -r "$src/spell" $dest
[ -d "$src/colors" ] && echo "Syncing user colors" && cp -r "$src/colors" $dest
[ -d "$src/after" ] && echo "Syncing after directory" && cp -r "$src/after" $dest
[ -d "$src/templates" ] && echo "Syncing templates" && cp -r "$src/templates" $dest
[ -d "$src/ftdetect" ] && echo "Syncing ftdetect" && cp -r "$src/ftdetect" $dest
fi

16
bin/push-vim Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Copies vim data from the dotfiles repo to the home directory.
set -e
src="$HOME/.dotfiles/vim"
dest="$HOME/.vim/"
if [ -d $src ]; then
[ -d "$src/spell" ] && echo "Syncing user dictionary" && cp -r "$src/spell" $dest
[ -d "$src/colors" ] && echo "Syncing user colors" && cp -r "$src/colors" $dest
[ -d "$src/after" ] && echo "Syncing after directory" && cp -r "$src/after" $dest
[ -d "$src/templates" ] && echo "Syncing templates" && cp -r "$src/templates" $dest
[ -d "$src/ftdetect" ] && echo "Syncing ftdetect" && cp -r "$src/ftdetect" $dest
fi

View File

@ -1,11 +0,0 @@
#!/bin/bash
set -e
if [ ! -d "~/.vim" ]; then
echo "Syncing user dictionary" && cp -r ~/.vim/spell ~/.dotfiles/vim/
echo "Syncing user colors" && cp -r ~/.vim/colors ~/.dotfiles/vim/
echo "Syncing after directory" && cp -r ~/.vim/after ~/.dotfiles/vim/
echo "Syncing templates" && cp -r ~/.vim/templates ~/.dotfiles/vim/
echo "Syncing ftdetect" && cp -r ~/.vim/ftdetect ~/.dotfiles/vim/
fi