-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·171 lines (140 loc) · 4.05 KB
/
install.sh
File metadata and controls
executable file
·171 lines (140 loc) · 4.05 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
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/bin/bash
set -u
set -e
INSTALL_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
install_debs() {
echo "++ Installing debs ++"
sudo apt-get update
sudo apt-get install build-essential cmake python-dev python3-pip exuberant-ctags nodejs zsh tmux fontconfig libfreetype6-dev libfontconfig1-dev xclip fuse curl
}
install_alacritty() {
echo "++ Installing alacritty ++ $INSTALL_DIR"
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustup override set stable
rustup update stable
mkdir -p ~/.config/alacritty/
ln -s $INSTALL_DIR/alacritty.yml ~/.config/alacritty/alacritty.yml
cargo install --git https://github.com/jwilm/alacritty
}
install_nvim() {
echo "++ Installing nvim ++ $INSTALL_DIR"
if [[ ! -d /opt/bin ]]; then
sudo mkdir -p /opt/bin
sudo chown ewan /opt/bin
fi
pip3 install neovim
curl -fLo /opt/bin/nvim.appimage --create-dirs https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
chmod u+x /opt/bin/nvim.appimage
rm -f /opt/bin/nvim
sudo ln -s /opt/bin/nvim.appimage /opt/bin/nvim
sudo ln -s /opt/bin/nvim.appimage /usr/local/bin/nvim
if [[ ! -d ~/.config/nvim/ ]]; then
mkdir -p ~/.config/nvim/
fi
rm -f ~/.config/nvim/init.vim
ln -s $INSTALL_DIR/nvim/init.vim ~/.config/nvim/init.vim
ln -s $INSTALL_DIR/nvim/ftdetect ~/.config/nvim/
ln -s $INSTALL_DIR/nvim/indent ~/.config/nvim/
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# Install vim-plug bundles
/opt/bin/nvim -c "execute \"PlugInstall\" | q | q"
}
install_vim() {
echo "++ Installing vim config ++ $INSTALL_DIR"
if [[ -d "$INSTALL_DIR/vim" ]]; then
cd $INSTALL_DIR/vim
git pull
else
git clone https://github.com/erbain/vim.git ./vim
fi
cd $INSTALL_DIR
if [[ -e ~/.vimrc ]]; then
read -p ".vimrc files exists, delete it and continue? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo 'Removing .vimrc file'
rm ~/.vimrc
else
echo "Quit without deleting .vimrc file"
exit
fi
fi
if [[ -e ~/.vim ]]; then
read -p ".vim folder exists, delete it and continue? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo 'Reming vim folder'
rm -Rf ~/.vim
else
echo "Quit without deleting .vim folder"
exit
fi
fi
ln -s $INSTALL_DIR/vim/.vimrc ~/.vimrc
ln -s $INSTALL_DIR/vim/ ~/.vim
# Install vundle bundles
vim -c "execute \"PlugInstall\" | q | q"
# Install JShint
sudo npm install jshint -g
cd $INSTALL_DIR
}
install_font() {
echo "++ Installing Fonts ++"
mkdir -p ~/.fonts
cp $INSTALL_DIR/fonts/Inconsolata\ Nerd\ Font\ Complete.otf ~/.fonts/
fc-cache -vf ~/.fonts
}
install_zsh() {
echo "++ Installing ZSH config ++"
if [[ -d $INSTALL_DIR/zsh/oh-my-zsh ]]; then
cd $INSTALL_DIR/zsh/oh-my-zsh
git pull
else
git clone https://github.com/robbyrussell/oh-my-zsh.git $INSTALL_DIR/zsh/oh-my-zsh
ln -si $INSTALL_DIR/zsh/oh-my-zsh ~/.oh-my-zsh
ln -si $INSTALL_DIR/zsh/zshrc ~/.zshrc
fi
cp -R $INSTALL_DIR/zsh/oh-my-zsh_custom/* $INSTALL_DIR/zsh/oh-my-zsh/custom/
echo 'stty -ixon' >> ~/.zshenv
echo "Setting default shell to zsh"
chsh -s /bin/zsh
}
install_i3() {
echo "++ Installing i3 config ++"
if [[ -d ~/.i3 ]]; then
read -p ".i3 folder exists, delete it and continue? " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo 'Removing .i3 folder'
rm -Rf ~/.i3
else
echo "Quit without deleting .i3 folder"
exit
fi
fi
cp -R $INSTALL_DIR/i3 ~/.i3
}
install_tmux() {
echo "++ Installing tmux config ++"
if [[ -e ~/.tmux.conf ]]; then
rm ~/.tmux.conf
fi
if [[ ! -d ~/.tmux/plugins ]]; then
mkdir -p ~/.tmux/plugins/
fi
if [[ ! -d ~/.tmux/plugins/tpm ]]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi
ln -s $INSTALL_DIR/tmux/tmux.conf ~/.tmux.conf
}
#install_debs
#install_vim
install_nvim
#install_font
#install_zsh
#install_tmux
#install_font
#install_alacritty
echo "All Done"