|
@@ -0,0 +1,46 @@ |
|
|
|
|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
missingCommands="" |
|
|
|
|
|
|
|
|
|
|
|
nodeVersion=$(node --version 2>&1 | cut -d. -f1 | sed 's/v//') |
|
|
|
|
|
|
|
|
|
|
|
if [ $? != 0 ]; then |
|
|
|
|
|
missingCommands="- node >= 8.0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
vimVersion=$(vim --version | head -n 1 | sed -E 's/VIM - Vi IMproved ([^ ]+).+/\1/') |
|
|
|
|
|
vimMajorVersion=$(echo $vimVersion | cut -d. -f1) |
|
|
|
|
|
vimMinorVersion=$(echo $vimVersion | cut -d. -f2) |
|
|
|
|
|
|
|
|
|
|
|
if [ "$missingCommands" != "" ]; then |
|
|
|
|
|
echo -e "You have to install the following commands before installing this extension:\n$missingCommands" |
|
|
|
|
|
exit 1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
stop=0 |
|
|
|
|
|
|
|
|
|
|
|
if [ "$nodeVersion" -lt "8" ]; then |
|
|
|
|
|
echo "This plugin requires NodeJS >= 8.0 (detected version $nodeVersion)." |
|
|
|
|
|
stop=1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ "$vimMajorVersion" -lt "8" -o "$vimMajorVersion" -ge "8" -a "$vimMinorVersion" -lt "1" ]; then |
|
|
|
|
|
echo "This plugin requires VIM >= 8.1 (detected version $vimVersion)." |
|
|
|
|
|
stop=1 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ "$stop" -eq "1" ]; then |
|
|
|
|
|
exit 1; |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
echo "Activating COC..." |
|
|
|
|
|
cat ~/.vimrc | sed "s/\" Plugin 'neoclide\/coc.nvim'/Plugin 'neoclide\/coc.nvim'/" > ~/.vimrc.tmp |
|
|
|
|
|
rm ~/.vimrc |
|
|
|
|
|
mv ~/.vimrc.tmp ~/.vimrc |
|
|
|
|
|
vim +PluginInstall +qall |
|
|
|
|
|
vim "+call coc#util#install()" +qall |
|
|
|
|
|
|
|
|
|
|
|
echo "COC is now ready for use!" |
|
|
|
|
|
echo "If you like this plugin, don't forget to send your ♥ to its author: https://github.com/neoclide/coc.nvim" |
|
|
|
|
|
echo "You can add support for your favourite languages by adding them: https://github.com/neoclide/coc.nvim/wiki/Language-servers#example-configuration-for-custom-language-servers" |
|
|
|
|
|
|