Difference between revisions of "Neovim"

From EdWiki

m (Vim-plug commands)
m (Vim-plug commands)
Line 74: Line 74:
[[File:prev.gif|left|link=EmSys:Neovim]][[File:home.gif|center|link=EmSys:Neovim]][[File:next.gif|right|link=EmSys:Neovim Setting up the basics]]
[[File:prev.gif|left|link=EmSys:Neovim]] [[File:home.gif|centre|link=EmSys:Neovim]] [[File:next.gif|right|link=EmSys:Neovim Setting up the basics]]

Revision as of 07:39, 21 February 2021

Plugins with Vim-Plug

Installing Neovim

  • On Mac
 brew install neovim 
  • Ubuntu
 sudo apt install neovim
  • Arch
sudo pacman -S neovim

Create config

Make directory for your Neovim config

mkdir ~/.config/nvim

Create an init.vim file

touch ~/.config/nvim/init.vim

Install vim-plug

curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs

You should now have plug.vim in your autoload directory so it will load of on start

Add a new file for plugins

We will manage our plugins in a separate file for the sake of my own sanity

mkdir ~/.config/nvim/vim-plug
touch ~/.config/nvim/vim-plug/plugins.vim

Let's add some plugins

Add the following to ~/.config/nvim/vim-plug/plugins.vim

  1. " auto-install vim-plug
  2. if empty(glob('~/.config/vim/autoload/plug.vim'))
  3.   silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
  4.     \
  5.   "autocmd VimEnter * PlugInstall
  6.   "autocmd VimEnter * PlugInstall | source $MYVIMRC
  7. endif
  8. call plug#begin('~/.config/nvim/autoload/plugged')
  9.     " Better Syntax Support
  10.     Plug 'sheerun/vim-polyglot'
  11.     " File Explorer
  12.     Plug 'scrooloose/NERDTree'
  13.     " Auto pairs for '(' '[' '{'
  14.     Plug 'jiangmiao/auto-pairs'
  15. call plug#end()

Source your plugins

Add the following line to init.vim

source $HOME/.config/nvim/vim-plug/plugins.vim

Vim-plug commands

Open nvim


Check the status of your plugins


Install all of your plugins


To update your plugins


After the update you can press d to see the differences or run


To remove plugins that are no longer defined in the plugins.vim file


Finally if you want to upgrade vim-plug itself run the following