Although Vim already provides very powerful features, a few good plugins can make your work even more efficient.
Install Plugins
If you want to install Vim plugins manually, you need to complete the following steps (it is not recommended to install manually, please refer to the Plugin Management content below):
Create the .vim folder
cd~mkdir.vim
Create the bundle folder in the .vim folder
cd.vimmkdirbundle
copy or clone the plugin to the bundle folder
cdbundlegitclone<repository-url>
Note: If the plugin does not have a git address, you can also create the relevant folder directly and place a .vim file in it.
Edit runtimepath
By modifying the runtimepath property, you can let Vim find the plugin you want to load. To view the runtimepath property, you can use the :set runtimepath command
You can enable new plugins by adding the following configuration to .vimrc
I personally prefer vim-plug, and I will briefly introduce this manager below.
vim-plug Introduction
Project Address
https://github.com/junegunn/vim-plug
Install
Download plug.vim, and put it in the autoload folder (usually this folder is located in ~/.vim/autoload/).
Unix
Neovim
Windows(PowerShell)
Configuration
Add the vim-plug configuration to ~/.vimrc:
The configuration starts with call plug#begin()
Plugin list, starting with the Plug command
End with call plug#end() to initialize the plugin system
This will automatically enable filetype plugin indent on and syntax enable. If you don't want this, you can reset your settings after this configuration, for example: filetype indent off, syntax off
Example
Restart Vim or reload .vimrc and execute :PlugInstall to install the configured plugin
" define the location to save plugins
call plug#begin('~/.vim/bundle')
" Note that single quotes should be used
" Some plugin list
" If the plugin's GitHub address is https://github.com/junegunn/vim-easy-align
" Then you can write like this
Plug 'junegunn/vim-easy-align'
" Or directly give the plugin git address
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
" Use `|` to separate multiple `Plug` commands in one line
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
" More configuration details can be found on the official website
" Initialize the plugin system
call plug#end()