⛏️How to Compile and Install Neovim on Debian

2024-10-10|2024-10-11
Yawatasensei
Yawatasensei
type
status
date
slug
summary
tags
category
icon
password
😀
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:
  1. Asynchronous Operations: Neovim allows you to perform asynchronous operations while editing files, such as code completion and syntax checking, thereby improving editing efficiency.
  1. Built-in Scripting Language: Neovim has Lua embedded as a scripting language, offering more customization options and plugins.
  1. User Interface Improvements: Neovim provides a more intuitive user interface, along with better keyboard shortcuts and operational experiences.
  1. Compatibility: Neovim is compatible with most Vim plugins, allowing you to easily port existing Vim configurations.
  1. Better Multi-tab Support: Neovim offers better multi-tab support, allowing you to quickly switch between multiple files.
  1. 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.
notion image

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:
In addition, you will need to install some Neovim dependencies, such as Python, Lua, etc. Use the following command to install these dependencies:

Download Source Code 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:

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:
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 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 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.
 
LobeChat For AndroidSolving the 'Failed to source defaults.vim' Error in OpenWRT Vim
Loading...