-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·68 lines (53 loc) · 1.71 KB
/
setup
File metadata and controls
executable file
·68 lines (53 loc) · 1.71 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
63
64
65
66
67
68
#!/bin/sh
# Original script from https://github.com/aharris88/dotfiles
# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles
dir=~/dotfiles # dotfiles directory
backupdir=~/dotfiles_backup # old dotfiles backup directory
# Files/dirs to symlink to ~
homefiles="gitconfig gitignore_global agignore vim vimrc basicvimrc nvim nvimrc tmux tmux.conf zshrc"
configfiles="htoprc"
echo "==================="
echo "Installing dotfiles"
echo "==================="
echo " "
echo "1. Creating $backupdir to backup any existing dotfiles in ~ ..."
mkdir -p $backupdir
mkdir -p ~/dotfiles_old/config
# Change to the dotfiles directory
cd $dir
for file in $homefiles; do
echo " "
echo "[BACKUP] Moving $file from ~ to $backupdir/config ..."
mv ~/.$file ~/dotfiles_old/
ln -s $dir/$file ~/.$file
echo "[LINKED] $file"
done
for file in $configfiles; do
echo " "
echo "[BACKUP] Moving $file from ~ to $backupdir/config ..."
mv ~/.$file ~/dotfiles_old/config
ln -s $dir/$file ~/.config/$file
echo "[LINKED] $file"
done
# ===============
# Installers
# ===============
install_vim_plug () {
# Get the latest version from GitHub
# Then open vim and :PlugInstall
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "[INSTALLED] vimplug"
}
install_zplug () {
# Zplug: manage zsh plugins
curl -sL get.zplug.sh | zsh
echo "[INSTALLED] zplug"
}
install_tpm () {
# tmux Package manager
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
echo "[INSTALLED] tpm (tmux plugin manager)"
}
install_vim_plug
install_zplug
install_tpm