installer.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/sh
  2. # Standalone installer for Unixs
  3. # Original version is created by shoma2da
  4. # https://github.com/shoma2da/neobundle_installer
  5. if [ $# -ne 1 ]; then
  6. echo "You must specify the installation directory!"
  7. exit 1
  8. fi
  9. # Convert the installation directory to absolute path
  10. case $1 in
  11. /*) PLUGIN_DIR=$1;;
  12. *) PLUGIN_DIR=$PWD/$1;;
  13. esac
  14. INSTALL_DIR="${PLUGIN_DIR}/repos/github.com/Shougo/dein.vim"
  15. echo "Install to \"$INSTALL_DIR\"..."
  16. if [ -e "$INSTALL_DIR" ]; then
  17. echo "\"$INSTALL_DIR\" already exists!"
  18. fi
  19. echo ""
  20. # check git command
  21. type git || {
  22. echo 'Please install git or update your path to include the git executable!'
  23. exit 1
  24. }
  25. echo ""
  26. # make plugin dir and fetch dein
  27. if ! [ -e "$INSTALL_DIR" ]; then
  28. echo "Begin fetching dein..."
  29. mkdir -p "$PLUGIN_DIR"
  30. git clone https://github.com/Shougo/dein.vim "$INSTALL_DIR"
  31. echo "Done."
  32. echo ""
  33. fi
  34. # write initial setting for .vimrc
  35. echo "Please add the following settings for dein to the top of your vimrc (Vim) or init.vim (NeoVim) file:"
  36. {
  37. echo ""
  38. echo ""
  39. echo "\"dein Scripts-----------------------------"
  40. echo "if &compatible"
  41. echo " set nocompatible \" Be iMproved"
  42. echo "endif"
  43. echo ""
  44. echo "\" Required:"
  45. echo "set runtimepath+=$INSTALL_DIR"
  46. echo ""
  47. echo "\" Required:"
  48. echo "if dein#load_state('$PLUGIN_DIR')"
  49. echo " call dein#begin('$PLUGIN_DIR')"
  50. echo ""
  51. echo " \" Let dein manage dein"
  52. echo " \" Required:"
  53. echo " call dein#add('$INSTALL_DIR')"
  54. echo ""
  55. echo " \" Add or remove your plugins here like this:"
  56. echo " \"call dein#add('Shougo/neosnippet.vim')"
  57. echo " \"call dein#add('Shougo/neosnippet-snippets')"
  58. echo ""
  59. echo " \" Required:"
  60. echo " call dein#end()"
  61. echo " call dein#save_state()"
  62. echo "endif"
  63. echo ""
  64. echo "\" Required:"
  65. echo "filetype plugin indent on"
  66. echo "syntax enable"
  67. echo ""
  68. echo "\" If you want to install not installed plugins on startup."
  69. echo "\"if dein#check_install()"
  70. echo "\" call dein#install()"
  71. echo "\"endif"
  72. echo ""
  73. echo "\"End dein Scripts-------------------------"
  74. echo ""
  75. echo ""
  76. }
  77. echo "Done."
  78. echo "Complete setup dein!"