-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·34 lines (28 loc) · 958 Bytes
/
setup.sh
File metadata and controls
executable file
·34 lines (28 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# make sure that the script is being called from the right directory
pushd . > /dev/null
cd ${0%/*}
# check if the vimrc is a symbolic link
if [[ ! -h $HOME/.vimrc ]] ; then
echo "## -- linking to vimrc -- #"
rm $HOME/.vimrc &> /dev/null
ln -s $PWD/vimrc $HOME/.vimrc
fi
if [[ ! -h $HOME/.gvimrc ]] ; then
rm $HOME/.gvimrc &> /dev/null
ln -s $PWD/gvimrc $HOME/.gvimrc
fi
if [[ ! -h $HOME/.NERDTreeBookmarks ]] ; then
rm $HOME/.gvimrc &> /dev/null
ln -s $PWD/NERDTreeBookmarks.$(uname) $HOME/.NERDTreeBookmarks
fi
# make sure that vim-tmp directory exists ... if not, make it
EDITOR_TMP="${HOME}/.${EDITOR}-tmp"
if [[ "x$EDITOR_TMP" != "x" && ( ! -d $EDITOR_TMP || ! -d $EDITOR_TMP/backup ) ]] ; then
echo "## -- making editor-tmp: $EDITOR_TMP -- ##"
mkdir -p $EDITOR_TMP/backup
fi
# return to the original directory
popd > /dev/null
# make sure that the tmp folder and backup folder are present
mkdir -p ~/.vim-tmp/backup