Skip to content

Instantly share code, notes, and snippets.

@cigrainger
Last active March 3, 2021 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cigrainger/0b863f4ee1eb0c2510166da5fc2f6964 to your computer and use it in GitHub Desktop.
Save cigrainger/0b863f4ee1eb0c2510166da5fc2f6964 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
# install dependencies
sudo add-apt-repository ppa:neovim-ppa/stable
sudo add-apt-repository ppa:lazygit-team/release
sudo apt-get update
sudo apt-get install -y git \
curl \
zsh \
direnv \
editorconfig \
markdown \
cmake \
jq \
shellcheck \
neovim \
lazygit
# use zsh (needs to be before fzf)
sudo chsh -s $(which zsh) chris
# pull dotfiles
git clone --bare https://github.com/cigrainger/cfg.git $HOME/.cfg
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
}
mkdir -p .config-backup
config checkout
if [ $? = 0 ]; then
echo "Checked out config.";
else
echo "Backing up pre-existing dot files.";
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{}
fi;
config checkout
config config status.showUntrackedFiles no
# switch to zsh
exec zsh
# install fd
curl -LO https://github.com/sharkdp/fd/releases/download/v8.2.1/fd_8.2.1_amd64.deb
sudo dpkg -i fd_8.2.1_amd64.deb
rm fd_8.2.1_amd64.deb
# install ripgrep
curl -LO https://github.com/BurntSushi/ripgrep/releases/download/12.1.1/ripgrep_12.1.1_amd64.deb
sudo dpkg -i ripgrep_12.1.1_amd64.deb
rm ripgrep_12.1.1_amd64.deb
# install fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
yes | ~/.fzf/install
# install asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.0
# install nodejs (necessary for coc.nvim)
asdf plugin-add nodejs https://github.com/asdf-vm/asdf-nodejs.git
bash -c '${ASDF_DATA_DIR:=$HOME/.asdf}/plugins/nodejs/bin/import-release-team-keyring'
asdf install nodejs 14.15.5
asdf global nodejs 14.15.5
# install 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'
nvim --headless +PlugInstall +qall
# install tpm
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment