-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_debian.sh
executable file
·134 lines (120 loc) · 3.56 KB
/
setup_debian.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/sh
export CONF_SRC=`pwd`
cd ~
updated_apt_cache=0
# Install git?
s=$(which git)
if [ ${#s} -eq 0 ]
then
read -r -p "git installieren? [Y/n] " response
case $response in
[nN][oO]|[nN])
echo "Can't go on without git. Exiting."
exit
;;
*)
if [ $updated_apt_cache -eq 0 ]; then sudo apt-get update && updated_apt_cache=1; fi
sudo apt-get install -y git
;;
esac
fi
# Install tmux?
s=$(which tmux)
if [ ${#s} -eq 0 ]
then
read -r -p "tmux installieren? [Y/n] " response
case $response in
[nN][oO]|[nN])
;;
*)
if [ $updated_apt_cache -eq 0 ]; then sudo apt-get update && updated_apt_cache=1; fi
sudo apt-get install -y tmux
;;
esac
fi
# Backup & link files
timestamp=$(date +%s)
for f in .bashrc .bash_aliases .gitconfig .gitignore .gitignore .taskrc .tmux .tmux.conf .vim .vimrc .zshrc
do
dst=$(readlink $f)
if [ -e $f -a "$dst" != "dotfiles/$f" ]
then
echo $dst,$f
mv $f $f.$timestamp.backup
fi
ln -fs $CONF_SRC/$f $f
done
# Install Vundle
if [ ! -e .vim/bundle/Vundle.vim ]
then
mkdir .vim/bundle
mkdir .vim/bundle/Vundle.vim
git clone https://github.com/VundleVim/Vundle.vim .vim/bundle/Vundle.vim
fi
# Git config template
grep "\[user\]" .gitconfig > /dev/null || (
echo >> .gitconfig
echo "[user]" >> .gitconfig
echo " name = " >> .gitconfig
echo " email = " >> .gitconfig
)
grep "\[http\]" .gitconfig > /dev/null || (
echo >> .gitconfig
echo "[http]" >> .gitconfig
echo " proxy = " >> .gitconfig
)
# Install zsh?
sudo apt install -y fonts-powerline
s=$(which zsh)
if [ ${#s} -eq 0 ]
then
read -r -p "zsh installieren? [y/N] " response
case $response in
[yY][eE][sS]|[yY])
if [ $updated_apt_cache -eq 0 ]; then sudo apt-get update && updated_apt_cache=1; fi
sudo apt-get install -y zsh
chsh -s $(which zsh)
;;
*)
;;
esac
else
chsh -s $s
fi
# Install oh-my-zsh
# install dependencies
sudo apt-get install build-essential cmake
sudo apt-get install exuberant-ctags
sudo apt-get install python-dev python3-dev
if which zsh > /dev/null && [ ! -e .oh-my-zsh ] # install only if zsh is available and if .oh-my-zsh does not exist
then
git clone https://github.com/robbyrussell/oh-my-zsh.git .oh-my-zsh
# install bullet-train theme
wget http://raw.github.com/caiogondim/bullet-train-oh-my-zsh-theme/master/bullet-train.zsh-theme
mv bullet-train.zsh-theme .oh-my-zsh/themes
# install zsh-nvm plugin
git clone https://github.com/lukechilds/zsh-nvm .oh-my-zsh/custom/plugins/zsh-nvm
# change permissions
chmod g-w,o-w -R .oh-my-zsh/plugins
chmod g-w,o-w -R .oh-my-zsh/custom/plugins
fi
# Execute vim & update plugins
vim .gitconfig
vim +PluginUpdate .gitconfig
cd ~/.vim/bundle/YouCompleteMe
./install.py --clang-completer
cd ~
# WSL Powerline fonts
uname -a | grep -q Microsoft && {
echo "You are using this on WSL! Installing Powerline fonts on windows..."
git clone https://github.com/powerline/fonts $CONF_SRC/powerline-fonts
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -File 'powerline-fonts\install.ps1'
echo "Please change the font of your terminal emulator to 'Meslo LG S for Powerline'"
}
# Run zsh
[ $0 != $(which zsh) ] && zsh
echo 'You might want to install nodejs and vue:'
echo 'nvm upgrade'
echo 'nvm install -lts --latest-npm'
echo 'npm install -g yarn'
echo 'yarn global add vue @vue/cli'