VIM uses the Vundle management plugin

Source: Internet
Author: User
Tags git clone

Transferred from: http://os.51cto.com/art/201507/484174.htm

Vim is a versatile, lightweight text editing tool on Linux. Although it is quite difficult for ordinary Linux users to start learning, it is worth learning because of the benefits. As for functional aspects, VIM can be fully customized via plugins. However, due to its advanced configuration, you may need to spend some time on its plug-in system to be able to personalize vim efficiently. Fortunately, we have several tools to simplify our use of vim plugins. Vundle is a tool that I use every day.

1. Vundle Introduction

The full name of Vundle (Https://github.com/VundleVim/Vundle.vim) is the Vim Bundle, which is a vim plug-in management tool. Vundle allows you to install, update, search, and clean up vim plugins very easily. It can also manage your run-time environment and help with tagging. I will show you how to install and use Vundle in this tutorial.

2. Installing Vundle

First, if you don't have git on your Linux system, install it (http://ask.xmodulo.com/install-git-linux.html).

Next, create a directory where the VIM plugin will be installed after it is downloaded. By default, the directory is located in ~/.vim/bundle.

$ mkdir -p ~/.vim/bundle

Now install the Vundle as shown below. Please note: Vundle itself is another vim plugin. As a result, we installed the Vundle under the ~/.vim/bundle we created earlier.

$ git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
3. Configure Vundle

Now set up your. vimrc file as follows:

Set Nocompatible              "This is required filetype off                  " This is required   "you set the run-time path set Rtp+=~/.vim/bundle/vundle.vim   " Vundle Initialize call Vundle#begin ()   "This should always be the first Plugin ' Gmarik/vundle.vim '  " This example comes from https://github.com/gmarik/ Vundle.vim README Plugin ' tpope/vim-fugitive '   "from http://vim-scripts.org/vim/scripts.html plugin Plugin ' L9 '   " Git plugin not hosted on GitHub Plugin ' git://git.wincent.com/command-t.git '   "git repository on local machine (i.e. when writing your own plugin) Plugin ' file:///home/ The Gmarik/path/to/plugin '   "sparkup vim script is in the library subroutines directory of the software called Vim. "Pass the path and set the run-time path reasonably. Plugin ' Rstacruz/sparkup ', {' RTP ': ' vim/'}  ' with L9 avoid name collisions Plugin ' User/l9 ', {' name ': ' newL9 '}   "Each plug-in should be preceded by this line Call   Vundle#end ()            

You might want to explain the above configuration a little bit. By default, Vundle downloads and installs the Vim plugin from github.com or vim-scripts.org. You can modify the default behavior.

3.1. Plug-in installation method
    • To install from GitHub:
Plugin ‘user/plugin‘
    • To install from http://vim-scripts.org/vim/scripts.html:
Plugin ‘plugin_name‘
    • To install from another git repository:
Plugin ‘git://git.another_repo.com/plugin‘
    • To install from a local file:
Plugin ‘file:///home/user/path/to/plugin‘
3.2. Custom parameters

You can also customize other parameters, such as the run-time path of the plugin, which is useful if you are writing a plugin yourself, or if you want to load it from another directory that is not ~/.vim.

Plugin ‘rstacruz/sparkup‘, {‘rtp‘: ‘another_vim_path/‘}

If you have a plugin of the same name, you can rename the plugin so that it does not conflict.

Plugin ‘user/plugin‘, {‘name‘: ‘newPlugin‘}
4.Vundle Command Usage

Once you've set up the plugin with Vundle, you can use a few vundle commands to install, update, search, and clean unused plug-ins with Vundle.

4.1. Install a new plugin

The Plugininstall command installs all the plugins listed in your. vimrc file. You can also install only one specific plug-in, as long as you pass its name.

:PluginInstall :PluginInstall <plugin-name>
4.2. Clean unused plug-ins

If you have any unused plugins, just use the Pluginclean command to clean it up.

:PluginClean
4.3. Search for plugins

The search function is useful if you want to install a plugin from the list of plug-ins provided.

:PluginSearch <text-list>

During the search process, you can install, clean, study, or reload the same list on an interactive split screen. Installing the plugin does not automatically load your plugin. To automatically load the plugin, add the plugin to your. vimrc file.

This function is also often used, such as: Pluginsearch TagList, after the completion of the search, you can press ' I ' to install

5. Concluding remarks

Vim is a very good tool. Not only is it a great default text Editing tool, it can make your workflow faster and smoother, and can be converted into an IDE (integrated development environment) that supports almost any existing programming language. Vundle is great for quickly and easily personalizing a powerful vim environment.

Problem:

1. There has been a problem in the middle when call Vundle#begin () and call Vundle#end () are paired, always. VIMRC does not work, then switch to call VUNDLE#RC () and Filetpe plugin indent on both, Add the plugin to the middle.

2. Many plugins need to be set. VIMRC.

Vim using the Vundle Management plugin (RPM)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.