Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Vundle to manage the Vim plug-in

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to use Vundle to manage Vim plug-ins". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Vundle (Vim bundle) is a plug-in manager for Vim. It is the integration of git operations, users only need to go to the GitHub to find the name of the plug-in they want, install, update and uninstall can be completed by vundle.

Vundle installation

If you need Vundle, I will assume that Vim has been installed in your system. If not, install Vim and git (download Vundle). These two packages are available in official repositories in most GNU/Linux distributions. For example, on Debian series systems, you can install these two packages using the following command.

Sudo apt-get install vim git download Vundle

Copy the GitHub warehouse address of Vundle:

Git clone https://github.com/VundleVim/Vundle.vim.git ~ / .vim / bundle/Vundle.vim configure Vundle

Create a ~ / .vimrc file to inform Vim to use the new plug-in manager. This file is required to install, update, configure, and remove plug-ins.

Vim / .vimrc

At the top of this file, add the following lines:

Set nocompatible "be iMproved, requiredfiletype off" required "set the runtime path to include Vundle and initializeset rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin ()" alternatively, pass a path where Vundle should install plugins "call vundle#begin ('~ / some/path/here')" let Vundle manage Vundle, requiredPlugin 'VundleVim/Vundle.vim' "The following are examples of different formats supported." Keep Plugin commands between vundle#begin/end. " Plugin on GitHub repoPlugin 'tpope/vim-fugitive' "plugin from http://vim-scripts.org/vim/scripts.html" Plugin' L9'" Git plugin not hosted on GitHubPlugin 'git://git.wincent.com/command-t.git' "git repos on your local machine (i.e. When working on your own plugin) Plugin' file:///home/gmarik/path/to/plugin'" The sparkup vim script is in a subdirectory of this repo called vim." Pass the path to set the runtimepath properly.Plugin 'rstacruz/sparkup', {' rtp': 'vim/'} "Install L9 and avoid a Naming conflict if you've already installed a" different version somewhere else. " Plugin 'ascenator/L9', {' name': 'newL9'} "All of your Plugins must be added before the following linecall vundle#end ()" requiredfiletype plugin indent on "required" To ignore plugin indent changes, instead use: "filetype plugin on"Brief help": PluginList-lists configured plugins ": PluginInstall-installs plugins; append `! `to update or just: PluginUpdate": PluginSearch foo-searches for foo; append`! `to refresh local cache ": PluginClean-confirms removal of unused plugins Append `! `to auto-approve removal "" see: h vundle for more details or wiki for FAQ "Put your non-Plugin stuff after this line

The line marked "required" is the required configuration for Vundle. The rest of the lines are just examples. If you don't want to install those specific plug-ins, you can remove them. When you are finished, type: wq to save and exit.

Finally, open Vim:

Vim

Then type the following command to install the plug-in:

: PluginInstall

A new window will pop up and all the plug-ins we added to the .vimrc file will be installed automatically.

After installation, you can delete the cache and close the window by typing the following command:

: bdelete

You can also install the plug-in on the terminal without opening Vim using the following command:

Vim + PluginInstall + qall

Using friends of fish shell [1], add the following line to your .vimrc file.

Set shell=/bin/bash uses the Vundle Management Vim plug-in to add new plug-ins

First, search for available plug-ins using the following command:

: PluginSearch

To refresh the local list from the vimscripts website, add! after the command.

: PluginSearch!

A new window pops up with a list of available plug-ins:

You can also narrow your search by directly specifying the name of the plug-in.

: PluginSearch vim

This will list plug-ins that contain the keyword "vim".

Of course, you can also specify the exact plug-in name, such as:

: PluginSearch vim-dasm

Move the focus to the correct line and press I to install the plug-in. Now the selected plug-in will be installed.

Similarly, install all the plug-ins you want in your system. Once the installation is successful, delete the Vundle cache using the following command:

: bdelete

The plug-in is now installed. In order for the plug-in to load automatically correctly, we need to add the installed plug-in name to the .vimrc file.

Do this:

: e ~ / .vimrc

Add this line:

[...] Plugin 'vim-dasm' [...]

Replace vim-dasm with your own plug-in name. Then, click ESC and type: wq to save exit.

Note that all plug-ins must append the following to the .vimrc file.

[...] filetype plugin indent on lists installed plug-ins

List all installed plug-ins by typing the following command:

: PluginList update plug-in

Update the plug-in by typing the following command:

: PluginUpdate

Reinstall all plug-ins by typing the following command:

: PluginInstall! Uninstall the plug-in

First, list all installed plug-ins:

: PluginList

Then focus on the correct line and press the SHITF+d key combination.

Then edit your .vimrc file:

: e ~ / .vimrc

Delete the plug-in portal. Finally, type: wq save exit.

Alternatively, you can uninstall the plug-in by removing the .vimrc file line where the plug-in is located and executing the following command:

: PluginClean

This command will remove all plug-ins that are not in your .vimrc file but exist in the bundle directory.

You should have mastered the basic methods of managing plug-ins for Vundle. Use the following command in Vim to query the help documentation for more details.

H vundle "how to use Vundle to manage the Vim plug-in" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report