mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-05-06 00:36:35 +00:00
add vim-shell
This commit is contained in:
28
vim-shell/install.sh
Normal file
28
vim-shell/install.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user