-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup
executable file
·93 lines (78 loc) · 2.02 KB
/
setup
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
#!/bin/zsh
if [ ! -d ~/dotfiles ]; then
echo 'This script excpects dotfiles to be cloned in the home dir'
exit 1
fi
# -------------------------------------------------------------------
# Symlink dotfiles
dots=(
agignore
aliases
bin
completions
functions
fzfrc
gemrc
gitattributes
gitconfig
githelpers
gitignore_global
gitmessage
inputrc
prompt
pryrc
rspec
tmux.conf
vim
vimrc
zsh
zshrc
)
for dot in "${dots[@]}"
do
ln -sf "$HOME/dotfiles/$dot" "$HOME/.$dot"
done
mkdir -p "$HOME/.config"
ln -sf "$HOME/dotfiles/nvim" "$HOME/.config/nvim"
touch ~/.private_aliases
touch ~/.private_profile
touch ~/.tmux_private.conf
if [ $SPIN ]; then
git config --global user.email "[email protected]"
git config --global user.signingkey 15039BD59A5E6A5E48040923F95286C21AB66AF8
git config --global commit.gpgsign true
fi
# -------------------------------------------------------------------
# Install some packages
packages=(
exuberant-ctags
fzf
neovim
silversearcher-ag
)
if command -v apt-get &> /dev/null; then
for pkg in "${packages[@]}"
do
# yep, this won't actually work when package name differs from the
# executable (like ag) but oh well
if ! command -v $pkg &> /dev/null; then
sudo apt-get install -y $pkg
fi
done
fi
# -------------------------------------------------------------------
# Vim
# [[ -x /usr/bin/vim.basic ]] && alias vim=/usr/bin/vim.basic
mkdir -p ~/.vim/undo
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
vim -es -u vimrc -i NONE -c "PlugInstall" -c "qa"
# Neovim
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
python3 -m pip install --user --upgrade pynvim
nvim --noplugin --headless -c 'PlugInstall' -c 'qa'
# Tmux Plugin Manager
if [ ! -d ~/.tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi