forked from mxaddict/dotfiles_archive_001
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·139 lines (114 loc) · 3.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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
# Set GIT to use colors
git config --global color.ui auto
# Load up some default values from the environment!
GIT_NAME_CURRENT=$(git config --global user.name)
GIT_EMAIL_CURRENT=$(git config --global user.email)
# Ask what name to use?
printf "Git Name [$GIT_NAME_CURRENT]:"
read GIT_NAME_NEW
# Ask what email to use?
printf "Git Email [$GIT_EMAIL_CURRENT]:"
read GIT_EMAIL_NEW
# Ask if we want to update the plugins...
printf "Update/Install Plugins? [Y/n]:"
read UPDATE_PLUGINS
# Save the GIT_NAME
if [ "$GIT_NAME_NEW" != "" ]
then
git config --global user.name "$GIT_NAME_NEW"
fi
# Save the GIT_EMAIL
if [ "$GIT_EMAIL_NEW" != "" ]
then
git config --global user.email "$GIT_EMAIL_NEW"
fi
# Where is the DIR for dotfiles?
DOTFILES_DIR="${HOME}/.dotfiles"
# 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/reilg/dotfiles.git $DOTFILES_DIR
else
cd $DOTFILES_DIR && git fetch && git checkout origin/master
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 fetch && git checkout origin/master
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 ~/
# 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
# Check if we even want to install/update plugins
if [ "$UPDATE_PLUGINS" == "Y" ] || [ "$UPDATE_PLUGINS" == "y" ] || [ "$UPDATE_PLUGINS" == "" ]
then
# Install Vim Plugins
printf "Installing Vim Plugins, Will take a while depending on connection speed!\n"
vim +PlugUpgrade +PlugClean! +PlugUpdate +qall
fi
# Copy all our custom files!
cat $DOTFILES_DIR/.aliasrc > ~/.aliasrc
cat $DOTFILES_DIR/.bash_profile > ~/.bash_profile
cat $DOTFILES_DIR/.bashrc > ~/.bashrc
cat $DOTFILES_DIR/.pathrc > ~/.pathrc
cat $DOTFILES_DIR/.shrc > ~/.shrc
cat $DOTFILES_DIR/.tern-config > ~/.tern-config
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/z.sh > ~/z.sh
# Check if we have promptline setup already
if [ -d ~/.vim/plugged/promptline.vim ]
then
# Setup Promptline!
vim +"PromptlineSnapshot! ~/.promptline.sh" +qall
fi
# Check if we have tmuxline setup already
if [ -d ~/.vim/plugged/tmuxline.vim ]
then
# Setup Promptline!
vim +Tmuxline +"TmuxlineSnapshot! ~/.tmuxline.conf" +qall
fi
# Set our base16 theme
[ -n "$PS1" ] && \
[ -s "${BASE16_DIR}/profile_helper.sh" ] && \
eval "$("${BASE16_DIR}/profile_helper.sh")" && \
base16_material
# Install done! WEW!
printf "Install DONE! WEW!\n"