-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.zsh
76 lines (64 loc) · 2.32 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
#!/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" }
DOTFILES="${0:a:h}"
log "Linking..."
mkdir -p ~/.config/kitty/
# lns "$DOTFILES/zfunctions/dircolors-solarized/dircolors.ansi-light" $HOME/.dir_colors
mkdir -p "$HOME/.vim/backup"
mkdir -p "$HOME/.vim/undo"
lns "$DOTFILES/gitconfig" "$HOME/.gitconfig"
lns "$DOTFILES/gitignore" "$HOME/.gitignore"
lns "$DOTFILES/ignore" "$HOME/.ignore"
lns "$DOTFILES/spacemacs" "$HOME/.spacemacs"
lns "$DOTFILES/tmux.conf" "$HOME/.tmux.conf"
lns "$DOTFILES/vim" "$HOME/.vim"
lns "$DOTFILES/vimrc" "$HOME/.vimrc"
lns "$DOTFILES/zfunctions" "$HOME/.zfunctions"
lns "$DOTFILES/zshrc" "$HOME/.zshrc"
lns "$DOTFILES/config/kitty/kitty.conf" "$HOME/.config/kitty/kitty.conf"
lns "$DOTFILES/config/nvim" "$HOME/.config/nvim"
lns "$DOTFILES/LS_COLORS/LS_COLORS" "$HOME/.dir_colors"
tic -o ~/.terminfo xterm-256color-italic.terminfo
tic -o ~/.terminfo tmux-256color.terminfo
log "Sourcing zshrc..."
source ~/.zshrc
log "Setting up go (GOPATH=$GOPATH)..."
if [ -x "$(command -v go)" ]; then
mkdir -p $GOPATH
goget github.com/stamblerre/gocode
goget github.com/rogpeppe/godef
goget golang.org/x/tools/cmd/guru
goget golang.org/x/tools/cmd/gorename
goget golang.org/x/tools/cmd/goimports
fi
log "Fetching Vim plugins..."
vim +"PlugInstall | qall"
log "* coc"
vim +"CocInstall -sync coc-css coc-html coc-json \
coc-python coc-git coc-emmet coc-yank \
coc-emmet coc-yaml coc-vimlsp | qall"
log "* python"
python3 -m pip install --user --upgrade pynvim
log "* node"
npm install -g neovim
EMACS="$HOME/.emacs.d"
if [[ -e $EMACS ]]; then
log "Updating Spacemacs..."
git -C $EMACS pull
else
log "Cloning Spacemacs..."
git clone -b develop https://github.com/syl20bnr/spacemacs $EMACS
fi
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.