My personal Vim configuration.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

48 lines
1.2 KiB

  1. #!/bin/bash
  2. missingCommands=""
  3. npm --version > /dev/null 2>&1
  4. if [ $? -ne 0 ]; then
  5. missingCommands="- npm"
  6. fi
  7. xdg-open --version > /dev/null 2>&1
  8. if [ $? != 0 ]; then
  9. missingCommands="${missingCommands}\n- xdg-utils"
  10. fi
  11. curl --version > /dev/null 2>&1
  12. if [ $? != 0 ]; then
  13. missingCommands="${missingCommands}\n- curl"
  14. fi
  15. if [ "$missingCommands" != "" ]; then
  16. echo -e "You have to install the following commands before installing this extension:\n$missingCommands"
  17. exit 1
  18. fi
  19. which instant-markdown-d > /dev/null 2>&1
  20. if [ "$?" -ne 0 ]; then
  21. echo "This plugin needs you to install the following NPM package: https://www.npmjs.com/package/instant-markdown-d"
  22. echo "Please install it and restart this script to activate this plugin."
  23. exit 1
  24. fi
  25. echo "Activating Markdown support..."
  26. sudo npm -g install instant-markdown-d
  27. cat ~/.vimrc | sed "s/\" Plugin 'suan\/vim-instant-markdown'/Plugin 'suan\/vim-instant-markdown'/" > ~/.vimrc.tmp
  28. rm ~/.vimrc
  29. mv ~/.vimrc.tmp ~/.vimrc
  30. vim +PluginInstall +qall
  31. echo "Markdown support has been activated!"
  32. echo "If you like this plugin, don't forget to send your ♥ to its author: https://github.com/suan/vim-instant-markdown"