My personal Vim configuration.
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

activate-markdown 1.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. cat ~/.vimrc | sed "s/\" Plugin 'suan\/vim-instant-markdown'/Plugin 'suan\/vim-instant-markdown'/" > ~/.vimrc.tmp
  27. rm ~/.vimrc
  28. mv ~/.vimrc.tmp ~/.vimrc
  29. vim +PluginInstall +qall
  30. echo "Markdown support has been activated!"
  31. echo "If you like this plugin, don't forget to send your ♥ to its author: https://github.com/suan/vim-instant-markdown"