forked from tomnomnom/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·39 lines (32 loc) · 864 Bytes
/
Copy pathsetup.sh
File metadata and controls
executable file
·39 lines (32 loc) · 864 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
34
35
36
37
38
39
#!/usr/bin/env zsh
dotfilesDir=$(pwd)
function linkDotfile {
dest="${HOME}/${1}"
dateStr=$(date +%Y-%m-%d-%H%M)
if [ -h "${HOME}/${1}" ]; then
# Existing symlink
echo "Removing existing symlink: ${dest}"
rm "${dest}"
elif [ -f "${dest}" ]; then
# Existing file
echo "Backing up existing file: ${dest}"
mv "${dest}" "${dest}.${dateStr}"
elif [ -d "${dest}" ]; then
# Existing dir
echo "Backing up existing dir: ${dest}"
mv "${dest}" "${dest}.${dateStr}"
fi
echo "Creating new symlink: ${dest}"
ln -s ${dotfilesDir}/${1} ${dest}
}
linkDotfile .vim
linkDotfile .vimrc
linkDotfile .zshrc
linkDotfile .gitconfig
linkDotfile .inputrc
linkDotfile .curlrc
linkDotfile .gf
mkdir -p $dotfilesDir/.vim/bundle
cd $dotfilesDir/.vim/bundle
git clone https://github.com/VundleVim/Vundle.vim.git
vim +PluginInstall +qall