-
Notifications
You must be signed in to change notification settings - Fork 42
/
shell-setup.sh
executable file
·125 lines (103 loc) · 2.92 KB
/
shell-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
#!/usr/bin/env zsh
set -x
set -e
#######################
# BIN
#######################
function pull_repo() {
cd $1
git pull
cd -
}
mkdir -p $HOME/bin
# FASD
if [[ ! -f $HOME/bin/fasd ]]; then
git clone https://github.com/clvv/fasd.git /tmp/fasd
cd /tmp/fasd
PREFIX=$HOME make install
cd -
fi
# FZF
if [[ ! -f $HOME/.fzf/bin/fzf ]]; then
git clone https://github.com/junegunn/fzf.git $HOME/.fzf
yes | $HOME/.fzf/install
fi
# DIFF-SO-FANCY
if [[ ! -f $HOME/bin/diff-so-fancy ]]; then
curl -o $HOME/bin/diff-so-fancy https://raw.githubusercontent.com/so-fancy/diff-so-fancy/master/third_party/build_fatpack/diff-so-fancy
chmod +x $HOME/bin/diff-so-fancy
fi
#######################
# TMUX
#######################
if [[ ! -d $HOME/.tmux/plugins/tpm ]]; then
mkdir -p $HOME/.tmux/plugins
git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm
fi
pull_repo $HOME/.tmux/plugins/tpm
#######################
# ZSH
#######################
if [[ ! -d $HOME/.zprezto ]]; then
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
fi
cd $HOME/.zprezto
git pull
git submodule update --init --recursive
cd -
mkdir -p $HOME/.zsh
# Fast syntax highlighting
if [[ ! -d $HOME/.zsh/fast-syntax-highlighting ]]; then
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git $HOME/.zsh/fast-syntax-highlighting
fi
pull_repo $HOME/.zsh/fast-syntax-highlighting
#######################
# NEOVIM
#######################
NVIM=$HOME/.neovim
mkdir -p $NVIM
# AppImage in case the computer does not have a fallback nvim (appimage does not self update)
if command -v nvim > /dev/null; then
echo "NVIM appears to be installed"
else
mkdir -p $NVIM/bin
cd $NVIM/bin
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage
mv nvim.appimage nvim
cd -
fi
# Create Python3 environment
if [[ ! -d $NVIM/py3 ]]; then
python3 -m venv $NVIM/py3
PIP=$NVIM/py3/bin/pip
$PIP install --upgrade pip
$PIP install neovim
$PIP install 'python-language-server[all]'
$PIP install pylint isort jedi flake8
$PIP install black yapf
fi
# Create node env
if [[ ! -d $NVIM/node ]]; then
mkdir -p $NVIM/node
NODE_SCRIPT=/tmp/install-node.sh
curl -sL install-node.now.sh/lts -o $NODE_SCRIPT
chmod +x $NODE_SCRIPT
PREFIX=$NVIM/node $NODE_SCRIPT -y
PATH="$NVIM/node/bin:$PATH"
npm install -g neovim
fi
#######################
# RUST
#######################
if [[ ! -d $HOME/.rustup ]]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
for crate in bat fd-find ripgrep exa tealdeer procs ytop hyperfine bandwhich
do
$HOME/.cargo/bin/cargo install $crate
done