common/setup-home.sh

47 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Calculate directory relative to $HOME
DIR=$HOME
BASE=$(realpath --relative-to=$DIR $PWD)
pushd $HOME >> /dev/null
ln -vs $BASE/home/bashrc .bashrc
ln -vs $BASE/home/clang-format .clang-format
ln -vs $BASE/home/latexmkrc .latexmkrc
ln -vs $BASE/home/vimrc .vimrc
# This is copied because spacemacs generates its own metadata
cp $BASE/home/spacemacs/spacemacs.el .spacemacs
popd >> /dev/null
# Create ftplugin links
DIR=$HOME/.vim/after/ftplugin
BASE=$(realpath --relative-to=$DIR $PWD)
mkdir -p $DIR
pushd $DIR >> /dev/null
ln -vs $BASE/home/vim/after/ftplugin/tex.vim .
popd >> /dev/null
DIR=$HOME/.vim/colors
BASE=$(realpath --relative-to=$DIR $PWD)
mkdir -p $DIR
pushd $DIR >> /dev/null
ln -vs $BASE/home/vim/vim-amino/amino.vim .
popd >> /dev/null
DIR=$HOME/.config/fish
BASE=$(realpath --relative-to=$DIR $PWD)
mkdir -p $DIR
pushd $DIR >> /dev/null
ln -vs $BASE/home/fish/config.fish .
ln -vs $BASE/home/fish/fishd_color .
ln -vs $BASE/home/fish/functions .
popd >> /dev/null
DIR=$HOME/.config/rustfmt
BASE=$(realpath --relative-to=$DIR $PWD)
mkdir -p $DIR
pushd $DIR >> /dev/null
ln -vs $BASE/home/rustfmt.toml .
popd >> /dev/null