-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·62 lines (55 loc) · 1.61 KB
/
install
File metadata and controls
executable file
·62 lines (55 loc) · 1.61 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Hide dotfiles folder (needs to be done first or links break)
cd ~
if [[ -d ~/.dotfiles ]]; then
if [[ -d ~/dotfiles ]]; then
echo "Both ~/dotfiles and ~/.dotfiles folders found."
echo " (remove one and try install again)"
exit 1
fi
fi
if [[ -d ~/dotfiles ]]; then
mv ~/dotfiles ~/.dotfiles
fi
# Create symbolic links to .files in home folder
for f in ~/.dotfiles/.*
do
base=$(basename "$f")
# Skip certain files
if [ "$base" == "." ] || [ "$base" == ".." ] || [ "$base" == ".git" ] || [ "$base" == ".gitignore" ]; then
continue;
fi
target=${HOME}/${base}
# Check if .file exists and is a symlink; unlink
if [[ -L "$target" ]]; then
unlink "$target"
fi
# Check if .file exists; make backup and remove to use linked file
if [[ -f "$target" ]]; then
mv $target ${target}.orig
fi
# Make link in home folder
ln -s $f ~
done
# Check for vundle (vim package manager) and install if not present
if [ ! -d "${HOME}/.vim/bundle/Vundle.vim" ]
then
echo "Cloning vundle package manager..."
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
# Check for vim
if ! command -v vim &> /dev/null
then
echo " === vim not found ==="
fi
# Check for tmux
if ! command -v tmux &> /dev/null
then
echo " === tmux not found ==="
fi
# Install vim plugins (second argument initialises markdown-previewer)
vim +PluginInstall +"call mkdp#util#install()" +qa
echo "Install complete"
echo "----------------"
echo " Note that YouCompleteMe [vim plugin] requires compilaton with multiple"
echo " dependencies (https://github.com/ycm-core/YouCompleteMe#linux-64-bit)."