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