-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·48 lines (43 loc) · 1.52 KB
/
install
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
40
41
42
43
44
45
46
47
48
#!/bin/bash
# (c) Stefan Countryman 2017
# link and copy things from the dotfiles folder.
# assumes dotfiles are in ~/dev/dotfiles.
# if "-f" flag is provided, overwrite everything
if [ "$1"z = -fz ]; then
F=f
else
F=""
fi
# these files should be symlinked
for rcfile in $(find linkfiles -iname '.*' -exec basename {} \; ); do
if [ -L ~/"${rcfile}" ] || [ -e ~/"${rcfile}" ] && ! [ "$1"z = -fz ]; then
echo "${rcfile} exists, skipping (delete to link it or use -f flag)"
else
echo "linking ${rcfile}..."
ln -${F}s {dev/dotfiles/linkfiles,~}/"${rcfile}"
fi
done
# for now, these files should be copied, since they will be populated with
# sensitive information (TODO: fix this with auto-redact git hooks)
for rcfile in $(find ~/dev/dotfiles/copyfiles -iname '.*' -exec basename {} \; ); do
if [ -L ~/"${rcfile}" ] || [ -e ~/"${rcfile}" ] && ! [ "$1"z = -fz ]; then
echo "${rcfile} exists, skipping (delete to copy it or use -f flag)"
else
echo "copying ${rcfile}..."
cp -${F}R ~/{dev/dotfiles/copyfiles/,}"${rcfile}"
fi
done
pushd ~/dev/dotfiles
git submodule init
git submodule update
popd
# install vim-plug
echo installing vim-plug plugins
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim -es -u vimrc -i NONE -c "PlugInstall" -c "qa"
echo linking vim-plug for neovim
mkdir -p ~/.local/share/nvim/site/autoload
ln -s \
../../../../../.vim/autoload/plug.vim \
~/.local/share/nvim/site/autoload/plug.vim