Last active
October 14, 2019 00:15
-
-
Save eliohernanph/8c64d41d54accc99ee84b1fde68c5eb8 to your computer and use it in GitHub Desktop.
Install neovim on Linux (and maybe OSX) as Python and C# IDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Installation directory | |
| DIR=$HOME/app | |
| NVIM_URL_LINUX="https://github.com/neovim/neovim/releases/download/stable/nvim.appimage" | |
| NVIM_URL_MACOS="https://github.com/neovim/neovim/releases/download/stable/nvim-macos.tar.gz" | |
| mkdir -p ${DIR} | |
| cd ${DIR} | |
| # Install Neovim | |
| if [[ "$OSTYPE" == "linux-gnu" ]]; then | |
| mkdir nvim | |
| cd nvim | |
| curl -L $NVIM_URL_LINUX --output nvim.appimage | |
| chmod +x nvim.appimage | |
| ./nvim.appimage +qall | |
| ret=$? | |
| if [ $ret -ne 0 ]; then | |
| echo "Cannot run nvim as appimage" | |
| # TODO: try to extract appimage and run | |
| exit 1 | |
| else | |
| # Update .bashrc | |
| echo "alias vim=${DIR}/nvim/nvim.appimage" >> $HOME/.bashrc | |
| echo "alias nvim=${DIR}/nvim/nvim.appimage" >> $HOME/.bashrc | |
| alias vim=${DIR}/nvim/nvim.appimage | |
| fi | |
| elif [[ "$OSTYPE" == "darwin"* ]]; then | |
| curl -L $NVIM_URL_MACOS --output nvim.tar.gz | |
| tar xf nvim.tar.gz | |
| mv nvim-osx64 nvim | |
| cd nvim | |
| chmod +x bin/nvim | |
| ./bin/nvim +qall | |
| ret=$? | |
| if [ $ret -ne 0 ]; then | |
| echo "Cannot run nvim" | |
| exit 1 | |
| fi | |
| echo "export PATH=${DIR}/nvim/bin:"'$PATH' >> $HOME/.bash_profile | |
| echo "alias vim=nvim" >> $HOME/.bash_profile | |
| export PATH=${DIR}/nvim/bin:$PATH | |
| alias vim=nvim | |
| else | |
| echo "OS $OSTYPE not supported" | |
| exit 1 | |
| fi | |
| # Init neovim config | |
| mkdir -p $HOME/.config/nvim/colors | |
| git clone https://gist.github.com/5501c027c312516d2aa44f1c7194c46e.git nvimrc | |
| cat nvimrc/.vimrc > $HOME/.config/nvim/init.vim | |
| # Install python neovim package | |
| pip3 install neovim | |
| ret=$? | |
| if [ $ret -ne 0 ]; then | |
| echo "Cannot install python neovim package" | |
| exit 1 | |
| fi | |
| # Install jedi | |
| pip3 install jedi | |
| ret=$? | |
| if [ $ret -ne 0 ]; then | |
| echo "Cannot install python jedi package" | |
| exit 1 | |
| fi | |
| # Install vim-plug | |
| curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \ | |
| https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| # Install lucius.vim | |
| echo "Downloading lucius.vim" | |
| curl -fLo ~/.config/nvim/colors/lucius.vim --create-dirs \ | |
| https://raw.githubusercontent.com/jonathanfilip/vim-lucius/master/colors/lucius.vim | |
| # Install vim plug-ins | |
| $HOME/app/nvim/nvim.appimage +PlugInstall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment