How to manage Vim plug-ins
Vim is a lightweight generic text editor on Linux. Although the learning curve at the beginning may be very difficult for general Linux users, it is worth all of this compared to its advantages. Vim can add more and more functions through fully customizable plug-ins. However, because its function configuration is difficult, you need to spend some time to understand its plug-in system before it can effectively customize Vim. Fortunately, we already have some tools that make it easier for us to use the Vim plug-in. In my daily use, Vundle is used.
What is Vundle?
Vundle refers to the Vim Bundle, which is a vim plug-in manager. Vundle allows you to easily install, upgrade, search, or clear plug-ins. It can also manage your running environment and help with labels. In this tutorial, we will show you how to install and use Vundle.
Install Vundle
First, if you do not have Git on your Linux system, install Git first.
Git server setup and Client installation
Fedora downloads Git through Http Proxy
Install Git on Ubuntu Server
Create a Git repository on the server (Ubuntu)
Git simple tutorial in Linux (taking Android as an example)
Git authoritative guide PDF
Git 2-minute Guide
Git details: click here
Git: click here
Then, create a directory where the Vim plug-in will be downloaded and installed. By default, this directory is ~ /. Vim/bundle.
$ mkdir -p ~/.vim/bundle
Run the following command to install Vundle. Note that Vundle is also a vim plug-in. Therefore, we also install vundle to the previously created directory ~ /. Vim/bundle.
$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Configure Vundle
Now configure your. vimrc file as follows:
Set nocompatible "required.
Filetype off "required.
"Set the path of your runtime environment here.
set rtp+=~/.vim/bundle/Vundle.vim
"Initialize vundle
call vundle#begin()
"This line should always start.
Plugin 'gmarik/Vundle.vim'
"This demo comes from https://github.com/gmarik/Vundle.vim README
Plugin'tpope/vim-fugitive'
"Plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
"This Git plug-in is not on GitHub.
Plugin'git://git.wincent.com/command-t.git'
"Git repository path on the Local Computer (for example, when you are developing your own plug-in)
Plugin 'file:///home/gmarik/path/to/plugin'
"The vim script sparkup is stored in a sub-directory under the vim repository.
"Set this path to runtimepath correctly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
"Avoid conflicts with the name of '9'
Plugin'user/L9',{'name':'newL9'}
"All plug-ins should be before this line.
Call vundle # end () "is required.
Let me briefly explain the above settings: by default, Vundle will download and install the vim plug-in from github.com or the vim-scripts.org. You can also change the default behavior.
To install the plug-in from github:
Plugin'user/plugin'
To install:
Plugin'plugin_name'
To install it from another git Repository:
Plugin'git://git.another_repo.com/plugin'
Install from a local file:
Plugin'file:///home/user/path/to/plugin'
You can also customize other things, such as the runtime path of your plug-in. When you write a plug-in yourself, or you just want to get it from other directories -- instead ~ /. Vim -- this is very useful when loading plug-ins.
Plugin'rstacruz/sparkup',{'rtp':'another_vim_path/'}
If you have plug-ins with the same name, you can rename your plug-ins so that they will not conflict.
Plugin'user/plugin',{'name':'newPlugin'}
Use the Vum command
Once you use vundle to set your plug-ins, you can install, upgrade, search for plug-ins using several vundle commands, or clear useless plug-ins.
Install a new plug-in
PluginInstallThe command will install all the plug-ins listed in your. vimrc file. You can also pass a plug-in name to install a specific plug-in.
:PluginInstall
: PluginInstall <plug-in Name>
Clear unused plug-ins
If you have any unused plug-ins, you can usePluginCleanCommand to delete it.
:PluginClean
Find a plug-in
If you want to install a plug-in from the provided plug-in list, the search function is very useful.
: PluginSearch <text>
When searching, you can install, clear, re-search, or re-load the plug-in list in the interactive split window. The installed plug-ins do not take effect automatically. To make the plug-ins take effect, you can add them to your. vimrc file.
Summary
Vim is a wonderful tool. It is not just a default text editor that makes your work smoother and more efficient, but it also changes and becomes an existing IDE for almost any programming language.
Note that some websites can help you find the appropriate vim plug-in. Slam the http://www.vim-scripts.org, Github, or http://www.vimawesome.com to get a new script or plug-in. Remember to use the help provided by your plug-in.
Get up with your favorite editor!
-------------------------------------- Split line --------------------------------------
Build VIM into a simple and practical IDE
Vim Learning Guide
Quick learn Vi Editor
Powerful Vim Editor
Build a Vim Development Environment on CentOS 6.2
Install the highlighted Vim editing tool in CentOS 5.4
Vim tips: C language settings
Set the Vim row number in Ubuntu
Vim editor basic tutorial
-------------------------------------- Split line --------------------------------------
Via: http://xmodulo.com/manage-vim-plugins.html
Author: Christopher Valerio Translator: XLCYun (sleeve Hidden Cloud) Proofreader: wxy
This article was originally translated by LCTT and launched with the Linux honor in China
This article permanently updates the link address: