-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvagrant_setup.sh
executable file
·134 lines (113 loc) · 2.89 KB
/
vagrant_setup.sh
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
#!/bin/bash
bashfile=".zshrc"
str="alias vi='nvim'"
install_packages () {
if [ "$(uname)" = "Linux" ]; then
yes '' | sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt-get update
yes | sudo apt-get install \
curl \
zsh \
ctags \
neovim \
zsh-antigen \
cmake \
libfreetype6-dev \
libfontconfig1-dev \
xclip \
python3-pip \
direnv
# install ripgrep
curl -LO https://github.com/BurntSushi/ripgrep/releases/download/0.10.0/ripgrep_0.10.0_amd64.deb
sudo dpkg -i ripgrep_0.10.0_amd64.deb
rm ripgrep_0.10.0_amd64.deb
elif [ "$(uname)" = "Darwin" ]; then
brew install zsh ctags neovim antigen direnv ripgrep
#bashfile=".bash_profile"
fi
#if ! [ -x "$(command -v rustup)" ]; then
# curl https://sh.rustup.rs -sSf | sh
#fi
#
#if ! [ -x "$(command -v alacritty)" ]; then
# # install alacritty
# cargo install --git https://github.com/jwilm/alacritty
#fi
}
construct_shell_config () {
# add lines to shell RC file if it doesn't already contain them
if [ ! -f ~/$bashfile ]; then
cp .bashrc ~/$bashfile
elif grep "$str" ~/$bashfile > /dev/null; then
echo "FOUND"
else
cat .bashrc >> ~/$bashfile
fi
}
setup_antigen () {
# zsh package manager
if [[ ! -f ~/.antigen.zsh ]]; then
if [ "$(uname)" = "Darwin" ]; then
cat /usr/local/share/antigen/antigen.zsh > ~/.antigen.zsh
elif [ "$(uname)" = "Linux" ]; then
cat /usr/share/zsh-antigen/antigen.zsh > ~/.antigen.zsh
fi
fi
}
set_xdg_config_var () {
# set XDG_CONFIG_HOME if it's not already set
if [ ! $XDG_CONFIG_HOME ]; then
mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
fi
}
setup_tmux () {
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
cp .tmux.conf $HOME
}
setup_neovim () {
cp .vimrc $HOME
mkdir -p $XDG_CONFIG_HOME/nvim/
cp init.vim $XDG_CONFIG_HOME/nvim/
pri_dir=$(pwd)
cd $HOME
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
cd $pri_dir
pip3 install jedi
pip3 install neovim
pip3 install pylint
nvim --headless +PlugInstall +qa
nvim --headless +UpdateRemotePlugins +qa
}
setup_fonts_for_powerline () {
# set up powerline and its fonts
git clone --depth 1 https://github.com/powerline/fonts
cd fonts
./install.sh
cd ..
rm -rf fonts
}
setup_fzf () {
git clone --depth 1 https://github.com/junegunn/fzf ~/.fzf
# install fzf and answer yes to all its prompts
yes | ~/.fzf/install
}
install_pyenv () {
git clone https://github.com/pyenv/pyenv ~/.pyenv
}
install_poetry () {
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
}
install_packages
construct_shell_config
setup_antigen
set_xdg_config_var
install_pyenv
setup_tmux
setup_neovim
setup_fonts_for_powerline
setup_fzf
install_poetry
# Change user's default shell to zsh
chsh -s $(which zsh)
zsh