-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.zsh
executable file
·105 lines (87 loc) · 2.89 KB
/
setup.zsh
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
#!/bin/zsh
autoload -U colors && colors
err() { echo "$fg[red]$@$reset_color" }
note() { echo "$fg[cyan]$@$reset_color" }
log() { echo "$fg[green]$@$reset_color" }
goget() { go get "$@" 2>/dev/null || err "Failed" }
lns() { ln -Tfs "$1" "$2" }
skip() { note " already installed, skipping" }
DOTFILES="${0:a:h}"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
log "Linking..."
mkdir "$HOME/.bin" &>/dev/null
mkdir -p "$XDG_DATA_HOME" "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME" &>/dev/null
lns "$DOTFILES/gitconfig" "$HOME/.gitconfig"
lns "$DOTFILES/gitignore" "$HOME/.gitignore"
lns "$DOTFILES/ignore" "$HOME/.ignore"
lns "$DOTFILES/tmux.conf" "$HOME/.tmux.conf"
lns "$DOTFILES/zsh" "$HOME/.zsh"
lns "$DOTFILES/zshrc" "$HOME/.zshrc"
lns "$DOTFILES/config/nvim" "$HOME/.config/nvim"
lns "$DOTFILES/config/i3" "$HOME/.config/i3"
lns "$DOTFILES/dir_colors" "$HOME/.dir_colors"
lns "$DOTFILES/i3status.conf" "$HOME/.i3status.conf"
lns "$DOTFILES/rsync.excludes" "$HOME/.rsync.excludes"
tic -o ~/.terminfo xterm-256color-italic.terminfo
tic -o ~/.terminfo tmux-256color.terminfo
log "Sourcing zshrc..."
source "$HOME/.zshrc"
log "Version managers..."
log "* node (nvm)..."
if type nvm > /dev/null; then
skip
else
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
fi
log "* python (pyenv)"
if type pyenv > /dev/null; then
eval "$(pyenv init -)"
skip
else
curl https://pyenv.run | bash
eval "$(pyenv init -)"
fi
pip install --upgrade pip
log "* python (poetry)"
if type poetry > /dev/null; then
skip
else
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
fi
log "* ruby (rbenv)"
if [[ `uname` == 'Darwin' ]]; then
if type rbenv > /dev/null; then
skip
else
brew install rbenv
fi
else
err "Install rbenv manually: https://github.com/rbenv/rbenv"
fi
log "* rust (cargo)"
if type rustup > /dev/null; then
skip
else
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
rustup toolchain install nightly --allow-downgrade --profile minimal --component clippy
fi
log "Vim plugins and LSP..."
python3 -m pip install --user --upgrade pynvim
pip install python-language-server rope pyflakes pycodestyle yapf
npm upgrade -g dockerfile-language-server-nodejs
npm upgrade -g vscode-css-languageserver-bin
npm upgrade -g neovim
npm upgrade -g vim-language-server
npm upgrade -g vscode-html-languageserver-bin
gem install solargraph
if [[ `uname` == 'Darwin' ]]; then
note "You might want to go to https://brew.sh/ and install homebrew."
note 'Then `brew bundle`.'
fi
if [[ $SHELL != '/bin/zsh' ]]; then
err 'Do you need to change your shell to `zsh`?'
fi
log Done.