I've got Vim starting in a shell script to install some plugins. I'm using nvim --headless +PlugInstall +qall, but when Vim opens, it has the rest of the shell script (cd $HOME/.config/coc/extensions && yarn install &> /dev/null) open in a buffer. How can I prevent this?


echo 'Backing up old Vim config...' 
mv $HOME/.vimrc $HOME/.vimrc_back &> /dev/null
mv $HOME/.vim/ $HOME/.vim_back &> /dev/null
mv $HOME/.config/coc/ $HOME/.config/coc_back &> /dev/null
echo 'Downloading VDE...'
git clone https://github.com/-----/----- $HOME/VDE &> /dev/null
echo 'Setting up VDE...'
mv $HOME/VDE/src/.vimrc $HOME/.vimrc &> /dev/null
mv $HOME/VDE/src/.vim $HOME/.vim &> /dev/null
mv $HOME/VDE/src/coc $HOME/.config/coc &> /dev/null
rm -rf $HOME/VDE &> /dev/null
nvim --headless +PlugInstall +qall
cd $HOME/.config/coc/extensions && yarn install &> /dev/null
cd $HOME
nvim --headless +CocRebuild +qall
  • Added the script, though I've already managed to fix it
    – twlscnds
    Nov 12, 2020 at 13:37

1 Answer 1


I've fixed it by adding &> /dev/null to the nvim --headless +PlugInstall +qall command

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.