😀 This Article is fork from ⛏️How to Compile and Install Neovim on Debian
Neovim is an open-source Vim alternative that offers many enhanced features such as asynchronous operations, an embedded scripting language, and a built-in compiler. Compiling and installing Neovim on the Debian operating system requires some command-line skills. This article will detail how to compile and install Neovim on Debian.
📝 What is Neovim
Neovim is a highly customizable Vim-like editor that has several advantages over the original Vim editor:
- Asynchronous Operations: Neovim allows you to perform asynchronous operations while editing files, such as code completion and syntax checking, thereby improving editing efficiency.
- Built-in Scripting Language: Neovim has Lua embedded as a scripting language, offering more customization options and plugins.
- User Interface Improvements: Neovim provides a more intuitive user interface, along with better keyboard shortcuts and operational experiences.
- Compatibility: Neovim is compatible with most Vim plugins, allowing you to easily port existing Vim configurations.
- Better Multi-tab Support: Neovim offers better multi-tab support, allowing you to quickly switch between multiple files.
- Better LSP Support. However, the Neovim stable version in the Debian software repository is currently stuck at the 0.4X version, and the testing version is at 0.7.X, which is far behind in many feature optimizations, and many plugins no longer support it. Therefore, we adopt the method of compilation for installation.
Preparation Work Preparation Work
First, you need to ensure that your Debian system has the necessary compilation tools, such as GCC and make. If you haven't installed these tools, you can use the following command to install them:
sudo apt update
sudo apt install build-essential
In addition, you will need to install some Neovim dependencies, such as Python, Lua, etc. Use the following command to install these dependencies:
sudo apt install libtool libtool-bin autoconf automake cmake g++ pkg-config unzip
sudo apt install libncurses5-dev libncursesw5-dev libtinfo-dev libacl1-dev libgpm-dev gettext
sudo apt install libjemalloc-dev libpython3-dev libpython3-dev libpython-dev luajit libluajit-5.1-dev
Download Source Code
Now, you can download the source code of Neovim from GitHub. You can use the following command to download the latest version of the source code from GitHub:
git clone https://github.com/neovim/neovim.git
Compile and Install Compile and Install
Now that you are ready to compile and install Neovim, run the following command in the source code directory to compile and install:
cd neovim
make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_INSTALL_PREFIX=/usr/local/
sudo make install
After compilation, Neovim is installed in the /usr/local
folder, without the need for soft links or cp operations. You can also modify CMAKE_INSTALL_PREFIX
to the directory where you want to install it, and remember to add the directory to the environment variable PATH.
Compatibility Note
In addition to the Debian system, common Linux systems such as Ubuntu, Centos, Redhat, Kali, and even OpenWRT can also be compiled and installed through the method described in this article.
Binary File Installation
In addition to installing Neovim through compilation, you can also directly download the Neovim binary files from the Github Release Page for use. All major release versions are supported by this method.
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
tar xzvf nvim-linux64.tar.gz
cd nvim
cp bin/nvim /usr/bin/nvim
cp -rf lib/* /usr/lib/
cp -rf share/* /usr/share/
Top comments (0)