Introduction to vim plugin installation under Linux system

Introduction to vim plugin installation under Linux system

Install vim plugin manager

It is recommended to install the plugin manager when using the plugin for the first time, which can simplify the steps of installing the plugin.

1. Download the plug.vim file and place it in the following autoload directory depending on the operating system:
Linux: ~/.vim/autoload
Windows: ~\vimfiles\autoload\plug.vim

plug.vim address: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

insert image description here

2. The directory structure is as follows. The installed plug-ins will be stored in the plugged directory:

If there is no ~/.vim/autoload directory, create it using mkdir -p ~/.vim/autoload .

insert image description here

3. Add the plug-vim section to the ~/.vimrc file

Just write the plug-in you need between call plug#begin('~/.vim/plugged') and call plug#end()

call plug#begin('~/.vim/plugged')
"Use Plug "github user/project name" here to introduce the plug-in"
" Rainbow bracket Plug 'luochen1990/rainbow'
"
" History Plug 'mhinz/vim-startify'
"
call plug#end()

Plug 'luochen1990/rainbow'' indicates the plug-in we want to install, which is a plug-in that automatically colors code brackets.

4. Execute commands in vim. Install the plugin

Install plug-in :PlugInstall starts the plug-in installation.

You can use the following command to specify the installation of a specific plug-in :PlugInstall gist-vim

Uninstall plugin :PlugClean

First comment or delete the configuration information of the corresponding plug-in in the vimrc configuration file, and then execute the command

Update the vim-plug plugin itself :PlugUpgrade

Batch update all installed plug-ins :PlugUpdate

Plug-in status :PlugStatus

Use this command to view the status information of the currently installed plug-ins.

Add plugin demo

The following demonstrates how to add a plugin.

First, make sure that there is a plug.vim file in ~/.vim/autoload

insert image description here

Then open ~/.vimrc and add the required plugin name. Enter PlugInstall in command mode

insert image description here

insert image description here

The installation has been successful. Now open vim to see the effect.

1. History file plug-in. Type vim

Enter the corresponding number, or move the cursor to the corresponding entry and press <Enter> to open the file again.

insert image description here

1. Rainbow Brackets Plugin

Matching pairs of brackets display the same color.

insert image description here

I personally feel that rainbow brackets are very useful. The corresponding brackets can be clearly identified.

insert image description here

To remove a plugin :

insert image description here
insert image description here

This is the end of this article about the installation of vim plug-in under Linux system. For more relevant linux vim plug-in installation content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Linux Vim Practical Commands Explained
  • How to operate vi and vim editors in Linux
  • Detailed explanation of Linux text editor Vim

<<:  Special effects of Bootstrap 3.0 study notes (display and hide, eliminate floating, close button, etc.)

>>:  A brief analysis of JS original value and reference value issues

Recommend

Detailed explanation of how to install MySQL on Alibaba Cloud

As a lightweight open source database, MySQL is w...

Improving the effect of hyperlinks in web design and production

Hyperlinks enable people to jump instantly from pa...

How to use bind to set up DNS server

DNS (Domain Name Server) is a server that convert...

The DOCTYPE mode selection mechanism of well-known browsers

Document Scope This article covers mode switching...

Vue implements simple slider verification

This article example shares the implementation of...

Vue Element UI custom description list component

This article example shares the specific code of ...

Continuous delivery using Jenkins and Docker under Docker

1. What is Continuous Delivery The software produ...

How to uninstall MySQL 5.7 on CentOS7

Check what is installed in mysql rpm -qa | grep -...

How to implement n-grid layout in CSS

Common application scenarios The interfaces of cu...

Detailed explanation of the problem when combining CSS ellipsis and padding

Text truncation with CSS Consider the following c...

CSS uses calc() to obtain the current visible screen height

First, let's take a look at the relative leng...

Docker advanced method of rapid expansion

1. Command method Run the nginx service in the cr...

Configure Mysql master-slave service implementation example

Configure Mysql master-slave service implementati...