-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
executable file
·81 lines (67 loc) · 2.02 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
#!/bin/bash
set -e
confirm() {
local msg="$1"
echo -n "$msg [y/N] "
shift
read -r confirmation
if [ "$confirmation" = y ]; then
"$@"
fi
}
install_jj() {
local arch=x86_64
local os=linux
if [ "$(uname)" = Darwin ]; then
arch=aarch64
os=darwin
fi
local download_url="$( \
curl https://api.github.com/repos/jj-vcs/jj/releases | \
jq -r ".[0].assets | .[] | select(.name | contains(\"$arch\")) | select(.name | contains(\"$os\")) | .browser_download_url")"
echo "Downloading JJ from $download_url"
local tmpdir="$(mktemp -d)"
curl -Lo "$tmpdir/jj.tar.gz" "$download_url"
tar -xzf "$tmpdir/jj.tar.gz" -C "$tmpdir"
mv "$tmpdir/jj" ~/.local/bin/jj
echo "Installed JJ: $(jj --version)"
rm -fr "$tmpdir"
}
if [ ! "$(uname)" = Darwin ]; then
confirm 'install packages?' \
sudo apt install fzf tmux vim zsh git tree figlet jq eza ripgrep podman ruby
fi
confirm 'install jj?' \
install_jj
if ! [[ "$SHELL" = *zsh ]]; then
chsh -s "$(which zsh)"
fi
keyfile=~/.ssh/id_ed25519
if [ ! -f "$keyfile" ]; then
ssh-keygen -t ed25519 -f $keyfile -N ''
fi
if [ "$1" = "keys" ]; then
curl -L https://github.com/willhbr.keys >> ~/.ssh/authorized_keys
fi
# ZSH
pug get zsh github: zsh-users/zsh-autosuggestions
pug get zsh github: zsh-users/zsh-syntax-highlighting
# Vim Plugins
pug get vim github: avm99963/vim-jjdescription
pug get vim github: ctrlpvim/ctrlp.vim
pug get vim github: editorconfig/editorconfig-vim
pug get vim github: ervandew/supertab
pug get vim github: itchyny/lightline.vim
pug get vim github: jiangmiao/auto-pairs
pug get vim github: lfv89/vim-interestingwords
pug get vim github: mgee/lightline-bufferline
pug get vim github: rhysd/vim-crystal
pug get vim github: rust-lang/rust.vim
pug get vim github: vim-syntastic/syntastic
# Vim Syntax files
pug get vim github: udalov/kotlin-vim
pug get vim github: keith/swift.vim
pug get vim github: elixir-editors/vim-elixir
# Vim/ tmux navigation
pug get vim github: willhbr/vim-tmux-navigator
pug get tmux github: willhbr/vim-tmux-navigator