Introduction
Experiencing a tough way to set up my Neovim environment in Ubuntu server, I decided to write a blog to record the whole process.
Installation
The installation can simply be done via the following command:
sudo apt-get install neovim
However, you can not install the latest version of Neovim in this way. To install the latest version, try the following steps:
// Add the Neovim PPA to your sources
sudo add-apt-repository ppa:neovim-ppa/unstable
// Update your package lists and upgrade Neovim
sudo apt-get update
sudo apt-get install neovim
Personalization
You can configure the Neovim setup by modifying the files in ~/.config
. Here I just introduce one of the famous Neovim configurations by josean. The Github is as follows:
https://github.com/josean-dev/dev-environment-files
Josean released a video in Youtube to illustrate how to set up Neovim in Macos/Linux: Youtube Link
Clone the depositary and copy the nvim
folder to ~/.config
locally.
When you execute nvim .
command, the required packages are installed automatically. After that, you have to go the nvim/lua/josean
, and run the following command:
nvim plugins-setup.lua
In this case you are viewing the plugins-setup.lua
via Neovim, then input :w
to notify Neovim to install all the required plugins. (If you are doing this step over other files, for example, nvim-cmp.lua
inside plugins
, you will meet an error warning that some plugins can not be found.)
Tips
Neovim utilizes npm
to install and configure language-server (lsp), so make sure you have installed nodejs
and npm
in advance.
sudo apt-get install nodejs
sudo apt-get install npm
Besides, make sure your version of Neovim is over 0.8
nvim --version