forked from patrickcjh/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·62 lines (52 loc) · 1.98 KB
/
setup.sh
File metadata and controls
executable file
·62 lines (52 loc) · 1.98 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
#!/bin/bash
UBUNTU_YEAR=$(lsb_release -sr | cut -d '.' -f1)
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
read -p "Set timezone in ~/.profile to 'Asia/Kuala_Lumpur' ? (y/n) : " yn
if [ "$yn" = "y" ]; then
echo "TZ='Asia/Kuala_Lumpur'; export TZ" >> ~/.profile
fi
read -p "Remove existing dotfiles and replace with link to repo? (y/n) : " yn
if [ "$yn" = "y" ]; then
rm -rf ~/.bash_aliases
ln -sT $SCRIPTPATH/.bash_aliases ~/.bash_aliases
rm -rf ~/.gitconfig
cp $SCRIPTPATH/.gitconfig ~/.gitconfig
rm -rf ~/.gitignore_global
ln -sT $SCRIPTPATH/.gitignore_global ~/.gitignore_global
fi
read -p "Setup byobu? (y/n) : " yn
if [ "$yn" = "y" ]; then
rm -rf ~/.byobu && ln -sT $SCRIPTPATH/.byobu/ ~/.byobu
fi
read -p "Update git using git-core ppa? (y/n) : " gityn
read -p "Install git-delta? (y/n) " gitdeltayn
read -p "Install neovim and its companion? (y/n) : " yn
if [ "$yn" = "y" ]; then
mkdir ~/.config > /dev/null 2>&1
rm -rf ~/.config/nvim
ln -sT $SCRIPTPATH/.config/nvim/ ~/.config/nvim
if [ "$UBUNTU_YEAR" -lt 20 ]; then
sudo add-apt-repository ppa:x4121/ripgrep -y
fi
sudo apt-get update
sudo apt-get install ripgrep xclip jq -y
# build neovim
sudo apt-get install ninja-build gettext cmake unzip curl -y
git clone https://github.com/neovim/neovim.git -b v0.10.4 --depth 1 /tmp/neovim
(cd /tmp/neovim && make CMAKE_BUILD_TYPE=Release && sudo make install)
rm -rf /tmp/neovim
# setup neovim
sudo update-alternatives --install $(which vim || echo "/usr/bin/vim") vim $(which nvim) 50
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 100
vim -c PlugInstall -c "qa"
fi
if [ "$gityn" = "y" ]; then
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y
fi
if [ "$gitdeltayn" = "y" ]; then
curl -fsSL -o /tmp/git-delta.deb https://github.com/dandavison/delta/releases/download/0.18.2/git-delta_0.18.2_amd64.deb
sudo apt-get install /tmp/git-delta.deb -y
rm /tmp/git-delta.deb
fi