mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-10-31 23:56:27 +00:00
41 lines
1.1 KiB
Bash
Executable File
41 lines
1.1 KiB
Bash
Executable File
#! /bin/bash
|
|
|
|
############################
|
|
# Vim Settings Setup script by ViViDboarder (Ian)
|
|
# http://github.com/ViViDboarder/Vim-Settings
|
|
############################
|
|
|
|
set -ex
|
|
|
|
# Get current directory for future use in links
|
|
VIM_SYNC_DIR=$(dirname "$0")
|
|
cd "$VIM_SYNC_DIR"
|
|
VIM_SYNC_DIR=$(pwd)
|
|
|
|
|
|
# Vim
|
|
[ -d "$HOME/.vim" ] || ln -s "$VIM_SYNC_DIR/vim" "$HOME/.vim"
|
|
[ -f "$HOME/.vimrc" ] || ln -s "$VIM_SYNC_DIR/vim/init.vim" "$HOME/.vimrc"
|
|
|
|
# Neovim
|
|
mkdir -p "${XDG_CONFIG_HOME:=$HOME/.config}"
|
|
[ -e "$XDG_CONFIG_HOME/nvim" ] || ln -s "$VIM_SYNC_DIR/neovim" "$XDG_CONFIG_HOME/nvim"
|
|
|
|
# Install all bundles
|
|
echo "Install all bundles"
|
|
if hash nvim 2>/dev/null; then
|
|
# Install plugins for old Neovim (<0.5)
|
|
nvim --headless -c PlugInstall -c qall
|
|
# Install plugins for new Neovim (>0.5)
|
|
nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerBootstrap" -c "PackerSync"
|
|
nvim --headless -c "lua require('plugins.treesitter').bootstrap()" -c quitall
|
|
nvim --headless -c "TSUpdateSync" -c "quitall"
|
|
fi
|
|
if hash vim 2>/dev/null; then
|
|
vim +PlugInstall +qall
|
|
fi
|
|
|
|
|
|
echo "All done!"
|
|
exit 0
|