diff options
Diffstat (limited to 'install')
-rwxr-xr-x | install/install.sh | 59 | ||||
-rw-r--r-- | install/utils/installer.sh | 86 |
2 files changed, 145 insertions, 0 deletions
diff --git a/install/install.sh b/install/install.sh new file mode 100755 index 00000000..ebd186b5 --- /dev/null +++ b/install/install.sh @@ -0,0 +1,59 @@ +#!/bin/sh + +if [ "$(uname)" == "Darwin" ]; then + echo 'MacOS Detected' + echo "installing miniconda" + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/.config/nvim/install/miniconda.sh + echo " Grabbing a font to use foe devicons " + brew tap caskroom/fonts + brew cask install font-hack-nerd-font +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + echo 'Linux Detected' + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/.config/nvim/install/miniconda.sh + mkdir -p ~/.local/share/fonts + cd ~/.local/share/fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf +fi + +#chmod +x ~/.config/nvim/install/miniconda.sh + +sh ~/.config/nvim/install/miniconda.sh -b -f -p $HOME/.miniconda + +echo 'export PATH="$HOME/.miniconda/bin:$PATH"' >> ~/.bash_profile + +. ~/.bash_profile + +conda create --name neovim python=3.7 --yes + +. activate neovim + +pip install neovim + +. deactivate + +conda create --name pyls python=3.7 --yes + +. activate pyls + +pip install 'python-language-server[all]' +pip install vim-vint + +. deactivate + +pip install 'python-language-server[all]' + +if [ ! -f ~/.bash_aliases ]; then + echo ".bash_aliases not found!" + touch ~/.bash_aliases + echo 'source ~/.bash_aliases' >> ~/.bashrc +fi + +echo 'alias mkenv="conda create --clone pyls --name"' >> ~/.bash_aliases + +echo 'let g:python3_host_prog = expand("~/.miniconda/envs/neovim/bin/python3.7")' > ~/.config/nvim/modules/pythonpath.vim + +if [ ! -d ~/.config/nvim/dein ]; then + echo "dein package manager not found" + sh ~/.config/nvim/install/utils/installer.sh ~/.config/nvim/dein +fi + +rm ~/.config/nvim/install/miniconda.sh diff --git a/install/utils/installer.sh b/install/utils/installer.sh new file mode 100644 index 00000000..de8c093e --- /dev/null +++ b/install/utils/installer.sh @@ -0,0 +1,86 @@ +#!/bin/sh +# Standalone installer for Unixs +# Original version is created by shoma2da +# https://github.com/shoma2da/neobundle_installer + +if [ $# -ne 1 ]; then + echo "You must specify the installation directory!" + exit 1 +fi + +# Convert the installation directory to absolute path +case $1 in + /*) PLUGIN_DIR=$1;; + *) PLUGIN_DIR=$PWD/$1;; +esac +INSTALL_DIR="${PLUGIN_DIR}/repos/github.com/Shougo/dein.vim" +echo "Install to \"$INSTALL_DIR\"..." +if [ -e "$INSTALL_DIR" ]; then + echo "\"$INSTALL_DIR\" already exists!" +fi + +echo "" + +# check git command +type git || { + echo 'Please install git or update your path to include the git executable!' + exit 1 +} +echo "" + +# make plugin dir and fetch dein +if ! [ -e "$INSTALL_DIR" ]; then + echo "Begin fetching dein..." + mkdir -p "$PLUGIN_DIR" + git clone https://github.com/Shougo/dein.vim "$INSTALL_DIR" + echo "Done." + echo "" +fi + +# write initial setting for .vimrc +echo "Please add the following settings for dein to the top of your vimrc (Vim) or init.vim (NeoVim) file:" +{ + echo "" + echo "" + echo "\"dein Scripts-----------------------------" + echo "if &compatible" + echo " set nocompatible \" Be iMproved" + echo "endif" + echo "" + echo "\" Required:" + echo "set runtimepath+=$INSTALL_DIR" + echo "" + echo "\" Required:" + echo "if dein#load_state('$PLUGIN_DIR')" + echo " call dein#begin('$PLUGIN_DIR')" + echo "" + echo " \" Let dein manage dein" + echo " \" Required:" + echo " call dein#add('$INSTALL_DIR')" + echo "" + echo " \" Add or remove your plugins here like this:" + echo " \"call dein#add('Shougo/neosnippet.vim')" + echo " \"call dein#add('Shougo/neosnippet-snippets')" + echo "" + echo " \" Required:" + echo " call dein#end()" + echo " call dein#save_state()" + echo "endif" + echo "" + echo "\" Required:" + echo "filetype plugin indent on" + echo "syntax enable" + echo "" + echo "\" If you want to install not installed plugins on startup." + echo "\"if dein#check_install()" + echo "\" call dein#install()" + echo "\"endif" + echo "" + echo "\"End dein Scripts-------------------------" + echo "" + echo "" +} + +echo "Done." + +echo "Complete setup dein!" |