From f0d80c41d6a0f1fb627393517deb93b75c8005f6 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Mon, 6 Jan 2020 13:05:39 -0500 Subject: [PATCH] Improve vim sync script --- bin/pull-vim | 16 ++++++++++++++++ bin/push-vim | 16 ++++++++++++++++ bin/sync-vim | 11 ----------- 3 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 bin/pull-vim create mode 100644 bin/push-vim delete mode 100644 bin/sync-vim diff --git a/bin/pull-vim b/bin/pull-vim new file mode 100644 index 0000000..eb93b95 --- /dev/null +++ b/bin/pull-vim @@ -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 diff --git a/bin/push-vim b/bin/push-vim new file mode 100644 index 0000000..a06ad10 --- /dev/null +++ b/bin/push-vim @@ -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 diff --git a/bin/sync-vim b/bin/sync-vim deleted file mode 100644 index 3a84e09..0000000 --- a/bin/sync-vim +++ /dev/null @@ -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