103 votes
Accepted

What is the Vim8 package feature and how should I use it?

First of all, the relevant documentation can be found with :h packages on the newly compiled Vim8 version and here on Github. A first important note is about the vocabulary: In Vim8 a package is ...
user avatar
  • 46.5k
85 votes
Accepted

How do I install a plugin in Vim/vi?

To install a plugin, we need to know what form it comes in. It can be: a single .vim file a Vimball file a set of files in directories that follow an expected structure (plugin/*, syntax/*, etc.) (...
user avatar
  • 23.9k
55 votes

How do I install a plugin in Vim/vi?

vim-plug I like to use the vim-plug plugin manager. The problem with manually installing a plugin is that it's rather difficult to remove a plugin; you often have several different files in ...
user avatar
39 votes

How do I install a plugin in Vim/vi?

Vim 8+ / Neovim Version 8 introduces a new packages mechanism that largely replaces the need for existing plugin managers (pathogen, vim-plug, vundle, etc.) at the time of writing (2017). From the ...
user avatar
28 votes
Accepted

How can I redefine plugin key mappings?

Plugins are sourced after your vimrc so there's no way to override a plugin mapping in your vimrc if the plugin doesn't provide a way to do so. Placing your custom mapping in ~/.vim/after/plugin/...
user avatar
  • 33.1k
27 votes
Accepted

Why aren't Vimballs commonly used?

The primary reason is precisely your second point, since there has been an active movement on a community level to use source control for managing plugins with the aid of plugin managers like pathogen,...
user avatar
  • 5,225
26 votes

How do I install a plugin in Vim/vi?

Pathogen Pathogen is a runtime path manager, which loads plugins within Vim. It makes plugin installation simple; here's how it works: note: If you're using Windows, replace ~/.vim with $HOME\...
user avatar
  • 13.8k
25 votes

How can I redefine plugin key mappings?

As mentioned in other answers, the plugins are sourced after the vimrc is done. If you want to keep your overrides in your vimrc instead of doing an after plugin, you can use this "trick" anywhere in ...
user avatar
  • 8,072
25 votes
Accepted

Figure out which plugin is responsible for a key binding

You can use the following: :verbose map <c-p> replacing <c-p> with the key bind you're looking for. Prints something like this: Last set from ~/.vim/bundle/ctrlp.vim/plugin/ctrlp.vim
user avatar
  • 2,251
25 votes
Accepted

How to patch add in Fugitive plugin

Short Answer Just use the normal interactive buttons. In (regular) vim, pressing p drops you into the interactive terminal patch, so it's the interface you're used to. For neovim users: Just enter ...
user avatar
  • 21.5k
24 votes

GitHub for .vimrc and plugins

You don't need to store plugins in your VCS; you can also use a Vim package manager. Since yesterday, I use vim-plug: You can define plugins in your vimrc like so: call plug#begin('~/.vim/plugged') ...
user avatar
23 votes
Accepted

How to see if a plugin is active

How can I determine if a filetype plugin (such as vim-latexsuite) has been installed You could use :scriptnames which list all sourced files. Another option is to check for the variable indicating ...
user avatar
  • 6,420
21 votes
Accepted

How to conditionally load plugins

You can do this with Vim-Plug. See the README: " On-demand loading Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'tpope/vim-fireplace', { 'for': 'clojure' } I think you'll have to use ...
user avatar
  • 46.5k
19 votes
Accepted

Is it possible to use a delegate or to pass a function as argument in Vimscript?

To answer your question: the prototype of call() in the manual is call({func}, {arglist} [, {dict}]); the {arglist} argument needs to be literally a List object, not a list of arguments. That is, you ...
user avatar
  • 3,618
18 votes
Accepted

GitHub for .vimrc and plugins

How to deal with repositories-within-repositories has been an ongoing question with git. Git's submodules are one way of addressing the situation, at the expense of adding a little more complexity to ...
user avatar
  • 1,326
17 votes
Accepted

Settings and plugins when root (`sudo vim`)?

Rather than opening vim as root, you can simply save as root by redirecting to tee. Here is an example: :w !sudo tee % > /dev/null This may be useful to alias in your .vimrc, I use :Sw: command! ...
user avatar
16 votes
Accepted

Experimenting with vim/gvim in "virgin" mode

From Vim FAQ 2.5: vim -u NONE -U NONE -N -i NONE This starts Vim in nocompatible mode (-N), without reading your viminfo file (-i NONE), without reading any configuration file (-u NONE for ...
user avatar
  • 6,420
16 votes
Accepted

When should I use vim-addon-manager instead of a regular package manager?

N.B., I'm one of the original authors of Debian's vim-addon-manager (which I'll refer to as dvam for the rest of this answer, to avoid confusion with Marc Weber's vam). dvam is intended solely to ...
user avatar
  • 10.4k
16 votes

What is the Vim8 package feature and how should I use it?

The answer provided by @statox is very descriptive, but for a new user that can be distracting, because if they wanted that they could read the help file directly. Instead I want to outline what you ...
user avatar
  • 3,137
15 votes
Accepted

How do I install a .vimball Plugin?

Simply open the vimball file in Vim and then execute :source %. It will move the files to their appropriate folders in your ~/.vim directory. You don't need to be root as it just copies files to ...
user avatar
  • 5,886
14 votes

How do I install a plugin in Vim/vi?

Let us not forget the great & mighty Vundle! Vundle is a complete plugin manager, with functionality for: Searching for plugins (using :PluginSearch) Installing plugins (using :PluginInstall) ...
user avatar
  • 713
14 votes

What is the Vim8 package feature and how should I use it?

To expand on the "can it replace plugin managers", I used to use Vundle, which was fantastic, but now have replaced it with 18 or so lines of bash. I find it useful to use subfolders in the pack ...
user avatar
  • 241
13 votes
Accepted

Detect most resource hungry plugin

This isn't really possible. Vim doesn't have any concept of isolation, everything lives in a big, happy, single-threaded process, and resources are democratically shared among all plugins. The best ...
user avatar
  • 3,618
12 votes

What makes a plugin Vundle compatible and are other plugin managers interchangeable?

For a plugin to be Pathogen/Vundle/NeoBundle/Plug/VAM-compatible, it needs to follow the standard structure expected by Vim in your ~/.vim/ directory: STANDARD STRUCTURE PLUGIN STRUCTURE ~/...
user avatar
  • 33.1k
11 votes
Accepted

Summary of functions in current file?

You could try either TagList or TagBar but such a list could be generated as needed (no third party tool or configuration needed) with a simple: :g/func/# See :help :global. If you don't mind a ...
user avatar
  • 33.1k
11 votes
Accepted

How safe is it to use an unknown `_vimrc` or `vimscript` file?

Well, Vim can execute arbitrary commands with :!. It can set environment variables. Malware scripts that are shell scripts can, therefore, be run from Vimscript. It can make use of complex Perl, ...
user avatar
  • 23.9k
11 votes

How to patch add in Fugitive plugin

Here's another way to do it, all within fugitive. I believe some of this is new with the 3.0 release on Aug 20, 2019. Someone had created a "What's New?" video, which I sadly can't find now. ...
user avatar
  • 371
11 votes
Accepted

how to load vim8 optional packages in vimrc?

how to load vim8 optional packages in vimrc? The way to load vim8 optional packages in your vimrc is to use the :packadd! command, which will add them to your 'runtimepath', which will make the opt ...
user avatar
  • 26.3k
10 votes
Accepted

Plugin help files not found

you have to create the help-tags. Run :helptags for the dir where you installed the docs. On unix this would most likely be :helptags ~/.vim/doc. Or simply recreate them all with :helptags ALL
user avatar
  • 2,599

Only top scored, non community-wiki answers of a minimum length are eligible