Skip to content

Instantly share code, notes, and snippets.

@kmhofmann
Created April 27, 2018 14:52
Show Gist options
  • Save kmhofmann/569f3de139e3fffe5dfb6307afae6c2a to your computer and use it in GitHub Desktop.
Save kmhofmann/569f3de139e3fffe5dfb6307afae6c2a to your computer and use it in GitHub Desktop.
A shell script to bootstrap tmux and nvim installation on Debian-like systems (e.g. RPi).
#!/usr/bin/env bash
#
# Bootstrapping some tools for Debian-like systems,
# e.g. Raspberry Pis running Raspbian, etc.
#
sudo apt-get install wget curl git build-essential python-pip python3-pip vim \
cmake ninja-build libtool libtool-bin autoconf automake cmake g++ \
pkg-config unzip texinfo libevent-dev libncurses-dev
mkdir -p $HOME/projects
git -C $HOME/projects clone https://github.com/kmhofmann/build_stuff.git
git -C $HOME/projects/build_stuff fetch
git -C $HOME/projects/build_stuff checkout master
git -C $HOME/projects clone https://github.com/kmhofmann/dotfiles.git
git -C $HOME/projects/dotfiles fetch
git -C $HOME/projects/build_stuff checkout master
# Build tmux
$HOME/projects/build_stuff/build_tmux.sh -s $HOME/devel -t $HOME/.local
if [[ ! -e "$HOME/projects/dotfiles/.tmux.conf"]]; then
cp $HOME/projects/dotfiles/.tmux.conf $HOME
fi
# Build neovim
$HOME/projects/build_stuff/build_neovim.sh -s $HOME/devel -t $HOME/.local
pip install --user --upgrade neovim
pip3 install --user --upgrade neovim
mkdir -p $HOME/.config/nvim
INIT_VIM=$HOME/.config/nvim/init.vim
echo "set runtimepath^=~/.vim runtimepath+=~/.vim/after" > ${INIT_VIM}
echo "let &packpath = &runtimepath" >> ${INIT_VIM}
echo "source ~/.vimrc" >> ${INIT_VIM}
if [[ ! -e "$HOME/projects/dotfiles/.vimrc"]]; then
cp $HOME/projects/dotfiles/.vimrc $HOME
fi
# Build CMake
#$HOME/projects/build_stuff/build_cmake.sh -s $HOME/devel -t $HOME/.local
# Update .profile
if [[ ! $(grep ".local" $HOME/.profile) ]]; then
echo "" >> $HOME/.profile
echo "export PATH=\$HOME/.local/bin:\$PATH" >> $HOME/.profile
fi
if [[ ! $(grep "alias vim" $HOME/.profile) ]]; then
echo "alias vim=nvim" >> $HOME/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment