#!/bin/bash # # Adapted from Junegunn Choi (junegunn.c@gmail.com) # https://github.com/junegunn/dotfiles/blob/master/install cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1 BASE=$(pwd) EXA_VER= # RC files mkdir -pv bak for rc in *rc *profile tmux.conf bashrc.d mutt ; do if [ ! -r $rc ] ; then continue fi [ $(realpath ~/."$rc") == $BASE/$rc ] if [ $? -ne 0 ] ; then [ -e ~/."$rc" ] && mv -v ~/."$rc" bak/."$rc" ln -sfv "$BASE/$rc" ~/."$rc" fi done if [ "$(which cargo)" == "" ] ; then # Install Cargo, in order to install exa etc. (curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh) || exit 1 source $HOME/.cargo/env fi cargo install delta bat exa sd GIT=$(which git) if [ "$GIT" != "" ] ; then mkdir -p ~/src/ pushd ~/src/ if [ ! -d fd ] ; then git clone https://github.com/sharkdp/fd.git cd fd else cd fd git pull fi cargo build --release ln -sfv $PWD/target/release/fd ~/bin popd else echo "You don't have git; can't install fd and a lot of Vim plugins are going to fail too." fi # git-prompt # if [ ! -e ~/.git-prompt.sh ]; then # curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh # fi # scripts mkdir -p ~/bin for bin in $BASE/bin/*; do BIN_NAME=$(basename $bin) [ $(realpath ~/bin/$BIN_NAME) == $bin ] if [ $? -ne 0 ] ; then ln -svf "$bin" ~/bin fi done if [ "$(uname -s)" = 'Darwin' ]; then # Homebrew [ -z "$(which brew)" ] && ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install \ fd ag wget git bat tmux bash-completion \ vim macvim jq # brew tap universal-ctags/universal-ctags # brew install --HEAD universal-ctags fi git config --global user.email "paul@blacksun.org.uk" git config --global user.name "Paul Walker" git config --global core.pager "delta --line-numbers --dark" git config --global delta.side-by-side true # git config --global delta.syntax-theme Dracula git config --global delta.syntax-theme "Solarized (dark)" if [ ! -d ~/.tmux/plugins/tpm ] ; then git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm if [ "$TMUX" != "" ] ; then # If we're currently in tmux, source the new file. tmux source-file ~/.tmux.conf fi fi ./install-vim