dotfiles/mklink.sh

61 lines
1.3 KiB
Bash
Raw Normal View History

2021-01-16 03:14:32 +00:00
#!/bin/bash
if [ -f "$HOME/.vimrc" ]; then
# backup old file
mv "$HOME/.vimrc" "$HOME/.vimrc.old"
fi
ln -sf "`pwd`/.vimrc" "$HOME/.vimrc"
2021-03-25 12:52:44 +00:00
if [ -f "$HOME/.ctags" ]; then
mv "$HOME/.ctags" "$HOME/.ctags.old"
fi
ln -sf "`pwd`/.ctags" "$HOME/.ctags"
2021-01-16 03:14:32 +00:00
if [ -f "$HOME/.gitconfig" ]; then
# backup old file
mv "$HOME/.gitconfig" "$HOME/.gitconfig.old"
fi
ln -sf "`pwd`/.gitconfig" "$HOME/.gitconfig"
2021-01-18 14:11:59 +00:00
if [ -f "$HOME/.tmux.conf" ]; then
# backup old file
mv "$HOME/.tmux.conf" "$HOME/.tmux.conf.old"
fi
ln -sf "`pwd`/.tmux.conf" "$HOME/.tmux.conf"
2021-01-16 03:14:32 +00:00
if [ ! -d "$HOME/.ssh" ]; then
mkdir -p "$HOME/.ssh"
fi
if [ -f "$HOME/.ssh/config" ]; then
# backup old file
mv "$HOME/.ssh/config" "$HOME/.ssh/config.old"
fi
cp "`pwd`/.ssh/config" "$HOME/.ssh/config"
2021-03-25 12:52:44 +00:00
if [ ! -d "$HOME/.config" ]; then
mkdir "$HOME/.config"
fi
if [ -d "$HOME/.config/nvim" ]; then
# backup old file
mv "$HOME/.config/nvim" "$HOME/.config/nvim.old"
fi
ln -sf "`pwd`/nvim" "$HOME/.config/nvim"
# install vim and nvim plug
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
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
## install vim dep
"./vim_dep.sh"