mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-03-03 01:40:17 +00:00
29 lines
675 B
Bash
29 lines
675 B
Bash
#!/bin/bash
|
|
|
|
function __init_vim_shell() {
|
|
set -e
|
|
set -u
|
|
|
|
mkdir -p "$HOME/.vim/plugins"
|
|
rm -rf "$HOME/.vim/plugins/shell.vim"
|
|
|
|
echo ""
|
|
|
|
if [ ! -e "$HOME/.vimrc" ]; then
|
|
touch "$HOME/.vimrc"
|
|
fi
|
|
|
|
if ! grep 'shell=' -r ~/.vimrc > /dev/null 2> /dev/null; then
|
|
printf '" bash set as default shell (for compatibility) by webinstall.dev/vim-shell\n' >> ~/.vimrc.new.1
|
|
printf 'set shell=bash\n' >> ~/.vimrc.new.1
|
|
printf '\n' >> ~/.vimrc.new.1
|
|
cat ~/.vimrc >> ~/.vimrc.new.1
|
|
mv ~/.vimrc.new.1 ~/.vimrc
|
|
fi
|
|
|
|
echo ""
|
|
echo "Vim default shell is set. Edit with 'vim ~/.vimrc'"
|
|
}
|
|
|
|
__init_vim_shell
|