Created
March 22, 2020 18:31
-
-
Save letam/107b0c2d702b0c49096f6e01835fe5d9 to your computer and use it in GitHub Desktop.
Install Neovim on Ubuntu
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 | |
| # Setup neovim on Ubuntu | |
| # Install neovim | |
| sudo snap install nvim --beta --classic | |
| if ! echo "$PATH" | grep -q "/snap/bin"; then | |
| file=~/.profile | |
| cp -p $file $file.bak.$(date -u +%Y-%m-%d-%H%M%S) | |
| echo -e '\n\nPATH=/snap/bin:$PATH' >> ~/.profile | |
| fi | |
| echo -e '#!/usr/bin/env bash\n\nnvim $@' | sudo tee /usr/local/bin/v | |
| sudo chmod +x /usr/local/bin/v | |
| # Install Ctags | |
| sudo apt -y install \ | |
| gcc make \ | |
| pkg-config autoconf automake \ | |
| python3-docutils \ | |
| libseccomp-dev \ | |
| libjansson-dev \ | |
| libyaml-dev \ | |
| libxml2-dev | |
| mkdir -v ~/packages | |
| cd ~/packages | |
| git clone https://github.com/universal-ctags/ctags.git | |
| cd ctags | |
| ./autogen.sh | |
| ./configure | |
| make | |
| sudo make install | |
| # Additional Setup | |
| mkdir -v ~/.vim | |
| ## Log Syntax highlighting | |
| mkdir -v ~/.vim/syntax | |
| cd ~/.vim/syntax | |
| curl -LOvJ "https://www.vim.org/scripts/download_script.php?src_id=20736" | |
| append_block '" Highlight logs\nau BufRead *access.log* setf httplog' >> ~/.vim/filetype.vim | |
| echo 'au BufRead *error.log* setf httplog' >> ~/.vim/filetype.vim | |
| # Neovim settings | |
| mkdir -vp ~/.config/nvim | |
| cat > ~/.config/nvim/init.vim << EOT | |
| set runtimepath^=~/.vim runtimepath+=~/.vim/after | |
| let &packpath = &runtimepath | |
| source ~/.vimrc | |
| EOT | |
| ## Python virtual envrionment for Neovim | |
| python3 -m venv ~/.vim/venv | |
| source ~/.vim/venv/bin/activate | |
| pip install -U pip setuptools | |
| pip install pynvim |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment