This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathinstall
executable file
·96 lines (74 loc) · 2.57 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env sh
# Set GIT to use colors
git config --global color.ui auto
# Save the GIT_NAME
git config --global user.name "Barry Deeney"
# Save the GIT_EMAIL
git config --global user.email "[email protected]"
# Add our global gitignore
git config --global core.excludesfile ~/.gitignore_global
# Where is the DIR for dotfiles?
DOTFILES_DIR="${HOME}/.files"
# Where do we have the CONFIG_DIR?
CONFIG_DIR="${HOME}/.config"
# Where is the DIR for base16-shell
BASE16_DIR="${CONFIG_DIR}/base16-shell"
# Create the CONFIG_DIR DIRECTORY
mkdir -p ${CONFIG_DIR}
# Check if we already have a copy of dotfiles
if [ ! -d $DOTFILES_DIR ]; then
# Now clone the repo...
git clone https://github.com/mxaddict/dotfiles.git $DOTFILES_DIR
else
cd $DOTFILES_DIR && git checkout master && git pull
fi
# Check if we already have a copy of base16-shell
if [ ! -d $BASE16_DIR ]; then
# Now clone the repo...
git clone https://github.com/chriskempson/base16-shell.git $BASE16_DIR
else
cd $BASE16_DIR && git checkout master && git pull
fi
# Check if we have ~/.vimrc.d
if [ -d ~/.vimrc.d ]; then
# Remove the OLD .vimrc.d/ DIR from home DIR
rm -r ~/.vimrc.d
fi
# Copy the .vimrc.d/ DIR to home DIR
cp -r $DOTFILES_DIR/.vimrc.d ~/
# Make the undo dir
mkdir -p ~/.vim/undo
# Check if our plugin manager is installed
if [ ! -f ~/.vim/autoload/plug.vim ]; then
# Install our plugin manager
printf "Installing our plugin manager\n"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
# Setup the vimrc for temporary use!
echo "source ~/.vimrc.d/plug.vim" > ~/.vimrc
# Make some symlinks...
if [ ! -h $CONFIG_DIR/nvim ]; then
ln -s ~/.vim $CONFIG_DIR/nvim
fi
# Make some symlinks...
if [ ! -h $CONFIG_DIR/nvim/init.vim ]; then
ln -s ~/.vimrc $CONFIG_DIR/nvim/init.vim
fi
# Install Vim Plugins
printf "Installing Vim Plugins, Will take a while depending on connection speed!\n"
vim +PlugUpgrade +PlugClean! +PlugUpdate +qall
# Copy all our custom files!
cat $DOTFILES_DIR/.aliasrc > ~/.aliasrc
cat $DOTFILES_DIR/.pathrc > ~/.pathrc
cat $DOTFILES_DIR/.shrc > ~/.shrc
cat $DOTFILES_DIR/.tmux.conf > ~/.tmux.conf
cat $DOTFILES_DIR/.vimrc > ~/.vimrc
cat $DOTFILES_DIR/.zsh_profile > ~/.zsh_profile
cat $DOTFILES_DIR/.zshrc > ~/.zshrc
cat $DOTFILES_DIR/.gitignore_global > ~/.gitignore_global
# Setup Promptline!
vim +"PromptlineSnapshot! ~/.promptline.sh" +qall
# Setup Tmuxline!
vim +Tmuxline +"TmuxlineSnapshot! ~/.tmuxline.conf" +qall
# Install done! WEW!
printf "Install DONE! WEW!\n"