2021-01-02 23:30:57 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-12-14 15:52:44 -08:00
|
|
|
|
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
|
|
relative() {
|
|
|
|
grealpath --relative-to=$1 $2
|
|
|
|
}
|
|
|
|
else
|
|
|
|
relative() {
|
|
|
|
realpath --relative-to=$1 $2
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
2021-01-02 23:30:57 -08:00
|
|
|
# Calculate directory relative to $HOME
|
2021-01-02 23:45:58 -08:00
|
|
|
DIR=$HOME
|
2022-12-14 15:52:44 -08:00
|
|
|
BASE=$(relative $DIR $PWD)
|
2021-01-02 23:30:57 -08:00
|
|
|
pushd $HOME >> /dev/null
|
2022-12-14 15:52:44 -08:00
|
|
|
ln -vs $BASE/home/rustfmt.toml .rustfmt.toml
|
2021-01-26 20:33:12 -08:00
|
|
|
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
|
2022-12-07 20:04:44 -08:00
|
|
|
|
|
|
|
# This is copied because spacemacs generates its own metadata
|
|
|
|
cp $BASE/home/spacemacs/spacemacs.el .spacemacs
|
2021-01-02 23:45:58 -08:00
|
|
|
popd >> /dev/null
|
2021-01-02 23:30:57 -08:00
|
|
|
|
2022-12-14 15:52:44 -08:00
|
|
|
# Vim
|
2021-01-02 23:45:58 -08:00
|
|
|
DIR=$HOME/.vim/after/ftplugin
|
2022-12-14 15:52:44 -08:00
|
|
|
BASE=$(relative $DIR $PWD)
|
2021-01-02 23:45:58 -08:00
|
|
|
mkdir -p $DIR
|
|
|
|
pushd $DIR >> /dev/null
|
2021-01-02 23:30:57 -08:00
|
|
|
ln -vs $BASE/home/vim/after/ftplugin/tex.vim .
|
|
|
|
popd >> /dev/null
|
|
|
|
|
2021-01-02 23:45:58 -08:00
|
|
|
DIR=$HOME/.vim/colors
|
2022-12-14 15:52:44 -08:00
|
|
|
BASE=$(relative $DIR $PWD)
|
2021-01-02 23:45:58 -08:00
|
|
|
mkdir -p $DIR
|
|
|
|
pushd $DIR >> /dev/null
|
|
|
|
ln -vs $BASE/home/vim/vim-amino/amino.vim .
|
2021-01-02 23:30:57 -08:00
|
|
|
popd >> /dev/null
|
|
|
|
|
2022-12-14 15:52:44 -08:00
|
|
|
# Fish
|
2021-01-02 23:45:58 -08:00
|
|
|
DIR=$HOME/.config/fish
|
2022-12-14 15:52:44 -08:00
|
|
|
BASE=$(relative $DIR $PWD)
|
2021-01-02 23:45:58 -08:00
|
|
|
mkdir -p $DIR
|
|
|
|
pushd $DIR >> /dev/null
|
2021-01-16 13:26:52 -08:00
|
|
|
ln -vs $BASE/home/fish/config.fish .
|
2021-01-02 23:45:58 -08:00
|
|
|
ln -vs $BASE/home/fish/fishd_color .
|
|
|
|
ln -vs $BASE/home/fish/functions .
|
2021-01-02 23:30:57 -08:00
|
|
|
popd >> /dev/null
|