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 Vim plug-ins on Linux

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly shows you "how to use Vundle on Linux to manage Vim plug-ins", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let Xiaobian lead you to study and learn "how to use Vundle to manage Vim plug-ins on Linux" this article.

There is no doubt that Vim is a powerful general tool for text file processing, capable of managing system configuration files and writing code. Through plug-ins, Vim can be extended to different levels of functionality. Typically, all plug-ins and attached configuration files are stored in the ~ / .vim directory. Because all plug-in files are stored in the same directory, different plug-in files are confused with each other as you install more plug-ins. Therefore, tracking and managing them will be a terrifying task. However, this is exactly what Vundle can handle. Vundle, which stands for Vim and Bundle respectively, is an extremely useful tool for managing Vim plug-ins.

Vundle creates a separate directory tree for each plug-in you install and stores additional configuration files in the corresponding plug-in directory. Therefore, there are no confusing documents with each other. In short, Vundle allows you to install new plug-ins, configure existing ones, update plug-in configurations, search for installed plug-ins, and clean up unused plug-ins. All operations can be done in one-click interactive mode. In this easy tutorial, let me show you how to install Vundle and how to use it in GNU/Linux to manage Vim plug-ins.

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.

*, 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

Friends who use fish shell, 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. *, 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 above are all the contents of the article "how to use Vundle to manage Vim plug-ins on Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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: 298

*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

Servers

Wechat

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

12
Report