Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to install Vim 8.2 on Ubuntu and its derivatives

Shulou Source: shulou.com Published: 2022-06-01 04:58:34 10月02日 Update

This article will explain in detail how to install Vim 8.2on Ubuntu and its derivatives. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

How to install Vim 8.2 on Ubuntu and its derivatives

You can install it by executing one of the following commands based on its system.

Ubuntu and its derivative version

[linuxidc@linux:~/www.linuxidc.com] $sudo add-apt-repository ppa:jonathonf/vim

[linuxidc@linux:~/www.linuxidc.com] $sudo apt-get update [linuxidc@linux:~/www.linuxidc.com] $sudo apt install vim

Arch Linux and its derivative version

[linuxidc@linux:~/www.linuxidc.com] $sudo pacman-S vim [linuxidc@linux:~/www.linuxidc.com] $flatpak install flathub org.vim.Vim

For anyone who likes Vim, the vim plug-in manager is a must. You can find some options available in. My personal favorite is vim-plug, which is a beautiful and minimalist plug-in for vim. Let's take a look at how to install and use this plug-in on Linux or Unix-like systems.

How to install vim-plug

Naturally, you must install vim on your system. For demonstration purposes, I use Ubuntu Linux. Download plug.vim and place it in the "autoload" directory:

[linuxidc@linux:~/www.linuxidc.com] $mkdir-p ~ / .vim/autoload/ [linuxidc@linux:~/www.linuxidc.com] $cd ~ / .vim/autoload/

Now let's use the wget or curl command to get the plugin.vim as follows:

[linuxidc@linux:~/.vim/autoload] $wget https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Or

[linuxidc@linux:~/.vim/autoload] $curl-O https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

As shown below:

How do I configure vim's plug-in manager vim-plug for Linux or Unix?

The syntax in ~ / .vimrc is as follows:

Specify the plug-in directory

Call plug#begin ('~ / .vim / plugged')

The plug-in allows you to use any valid git URL

Plug 'valid git URL'

Abbreviated symbols for plug-ins

Plug 'linuxidc/linux'

Initialize the plug-in system

Call plug#end ()

Example:

Suppose you want to use a bottom state enhancement / beautification vim plug-in called vim-airline. You need to add the following to the ~ / .vimrc file:

Call plug#begin ('~ / .vim / plugged') Plugin 'vim-airline/vim-airline' call plug#end ()

Save and close the file.

Install vim-airline or other plug-ins

Start the vim text editor:

[linuxidc@linux:~/www.linuxidc.com] $vim

To install vim-airline, enter:

: PlugInstall

An example of a session is as follows:

Use the following command to check the status:

: PlugStatus

To update the plug-in, enter:

: PlugUpdate

To upgrade the vim-plug itself, type the following in the vim session:

: PlugUpgrade

Clear

The PlugClean cleanup plug-in needs to be deleted or commented out in .vimrc now.

This is the end of this article on "how to install Vim 8.2on Ubuntu and its derivative version". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Tags: Plug-ins derivatives systems content commands articles files more status directories examples management input good practical effective beautiful simple one personal Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Technology Linux Shulou Information macOS