-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_linux.sh
executable file
·90 lines (74 loc) · 2.37 KB
/
setup_linux.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
#!/bin/bash
## *DEPRECATED*
##
## This setup script has not been maintained since 2020
## because there's no opportunity to use a linux machine.
function install_go() {
TMPDIR=$(mktemp -d)
wget https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz --directory-prefix "$TMPDIR"
sudo tar -xvf "$TMPDIR/go1.13.3.linux-amd64.tar.gz" -C /usr/local
export GOROOT=/usr/local/go
export GOPATH=~/repos
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
}
function init() {
# basic packages
sudo apt-get -y update
sudo apt-get -y install wget curl jq tree stow git tmux locales
# update locales
locale-gen en_US.UTF-8
export LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_CTYPE=en_US.UTF-8
# install python2 python3
sudo apt-get install -y software-properties-common
sudo apt-get install -y python-dev python-pip python3-dev python3-pip
pip install -U pip
pip install neovim
python3 -m pip3 install -U pip
python3 -m pip3 install neovim
# install node
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
npm update -g npm
npm install -g neovim
# install neovim
sudo add-apt-repository ppa:neovim-ppa/stable -y
sudo apt-get update
sudo apt-get install -y neovim
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# install fish
sudo apt-add-repository ppa:fish-shell/release-2 -y
sudo apt-get update
sudo apt-get install -y fish
# make ghq (git repos) dir
mkdir -p ~/repos/{bin,pkg,src}
# install peco, ghq
install_go
GOPATH=~/repos go get -u -v github.com/peco/peco
GOPATH=~/repos go get -u -v github.com/motemen/ghq
}
function deploy() {
[ -f ~/.config/functions/fish_prompt.fish ] &&
mv ~/.config/fish/functions/fish_prompt.fish ~/.config/fish/functions/fish_prompt.fish.old
# deploy .files with stow
stow -v -t ~/.config/fish -S fish
stow -v -t ~/.config/nvim -S neovim
stow -v -t ~/ -S git -S others
# # delete rows for mac
# if grep -q "reattach" "others/.tmux.conf"; then
# sed -i '/reattach/d' others/.tmux.conf
# fi
}
function clean() {
# clean .files with stow
stow -v -t ~/.config/fish -D fish
stow -v -t ~/.config/nvim -D neovim
stow -v -t ~/ -D git -D others
}
if [ "$1" = "init" ]; then
init
elif [ "$1" = "deploy" ]; then
deploy "$2"
elif [ "$1" = "clean" ]; then
clean
fi