-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·82 lines (63 loc) · 1.82 KB
/
install.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
#!/bin/bash
#
# Installs .dotfiles
#
# Check if .dotfiles are already installed
COUNT=$(grep -c 'dotfiles' ~/.bash_profile 2> /dev/null)
if [[ ! -z $COUNT ]] && [[ $COUNT -gt 0 ]]; then
echo ".dotfiles are already installed!"
exit
fi
# Continue with the install
echo "Installing .dotfiles..."
cp -f ~/.bash_profile ~/.bash_profile.bak
cp -f ~/.bashrc ~/.bashrc.bak
echo "source ~/.dotfiles/index-login.bash" > ~/.bash_profile
echo "source ~/.dotfiles/index-nonlogin.bash" > ~/.bashrc
ln -s ~/.dotfiles/.inputrc ~/.inputrc
mkdir ~/bin 2> /dev/null
for FILE in ~/.dotfiles/bin/*
do
NAME=$(basename $FILE)
ln -s -f $FILE ~/bin/$NAME
done
mkdir ~/.dotfiles.local 2> /dev/null
cp -n ~/.dotfiles/local/* ~/.dotfiles.local
# git
ln -s -f ~/.dotfiles/.gitconfig ~/.gitconfig
# git-extras
$(which git-extras)
if [[ $? -ne 0 ]]; then
git clone --depth 1 https://github.com/tj/git-extras.git /tmp/git-extras
cd /tmp/git-extras
rm bin/git-undo
rm man/git-undo*
sudo make install
fi
mkdir ~/apps
# z
git clone --depth 1 [email protected]:rupa/z.git ~/apps/z
# github cli
wget -O gh.deb https://github.com/cli/cli/releases/download/v2.57.0/gh_2.57.0_linux_amd64.deb
sudo dpkg -i ./gh.deb
rm ./gh.deb
# fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/apps/fzf
~/apps/fzf/install --no-key-bindings --no-completion --no-update-rc
# git-fuzzy
git clone --depth 1 https://github.com/bigH/git-fuzzy.git ~/apps/git-fuzzy
# delta
wget -O ./delta.deb https://github.com/dandavison/delta/releases/download/0.18.2/git-delta-musl_0.18.2_amd64.deb
sudo dpkg -i ./delta.deb
rm ./delta.deb
# vim
ln -s -f ~/.dotfiles/.vimrc ~/.vimrc
mkdir ~/.vim 2> /dev/null
# vim NERDTree plugin
cd ~/.vim
wget https://github.com/scrooloose/nerdtree/archive/4.2.0.tar.gz
tar xzf 4.2.0.tar.gz
cp -R nerdtree-4.2.0/* .
rm -rf nerdtree-4.2.0/
rm 4.2.0.tar.gz
echo "Done!"