-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·66 lines (47 loc) · 2.19 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
#!/bin/sh -ex
# NOTE: designed for and tested on ubuntu
echo "Installing git..."
sudo apt install -y git
install_zsh() {
echo "Installing zsh..."
sudo apt install -y zsh
echo "zsh version: $(zsh --version)"
echo "Setting zsh as default shell..."
chsh -s $(which zsh)
echo "Log out and log back in again to use your new default shell."
}
# Install zsh if needed
which zsh > /dev/null || install_zsh
# Install fuzzy finder
sudo apt install -y fzf
echo "Remeber to add the following to ~/.zshrc:"
echo "source /usr/share/doc/fzf/examples/key-bindings.zsh"
echo "Installing oh-my-zsh..."
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions.git $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
echo "Installing tmux..."
sudo apt install -y tmux tmuxp
echo "Installing oh-my-tmux..."
PATH_TO_OHMYTMUX=$HOME/.tmux
git clone https://github.com/gpakosz/.tmux.git ${PATH_TO_OHMYTMUX}
ln -s -f ${PATH_TO_OHMYTMUX}/.tmux.conf $HOME/.tmux.conf
cp ${PATH_TO_OHMYTMUX}/.tmux.conf.local ~/.tmux.conf.local
echo "You may proceed to customize your ~/.tmux.conf.local copy."
# clone the dotfiles repo to a temporary location
TEMPDOTFILES=$(mktemp -d)
git clone -b dotfiles --single-branch --separate-git-dir=$HOME/dotfiles.git https://github.com/sed-i/dotfiles.git $TEMPDOTFILES
# sync between temporary location and $HOME, just in case some files already exist
rsync --recursive --verbose --exclude '.git' $TEMPDOTFILES/. $HOME/
# clean up
rm -r $TEMPDOTFILES
# add handy alias
alias dotfiles='git --git-dir=$HOME/dotfiles.git --work-tree=$HOME'
echo "Remember to add the following to you ~/.bashrc and ~/.zshrc:"
echo "alias dotfiles='git --git-dir=\$HOME/dotfiles.git --work-tree=\$HOME'"
# do not show untracked files
dotfiles config --local status.showUntrackedFiles no
# vim stuff
# Install vim-plug (https://github.com/junegunn/vim-plug)
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'