110 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 ...
statox's user avatar
  • 49.6k
42 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 ...
Michael Kropat's user avatar
29 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 ...
D. Ben Knoble's user avatar
  • 25.8k
24 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 ...
mMontu's user avatar
  • 6,610
23 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 overwhelming. Instead I want to outline what you need to do in step-by-step pointers. Create pack/*/start directory ...
3N4N's user avatar
  • 5,624
22 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 ...
statox's user avatar
  • 49.6k
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 ...
jamessan's user avatar
  • 11k
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 ...
mMontu's user avatar
  • 6,610
16 votes

vim hangs when I open a typescript file

tldr; Add set re=2 into .vimrc prevents the issue on mac. I'm not sure why.
mrjarone's user avatar
  • 339
15 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 ...
Cam's user avatar
  • 251
13 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. ...
Phil R's user avatar
  • 481
12 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 ...
romainl's user avatar
  • 40k
12 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 ...
filbranden's user avatar
  • 28.7k
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, ...
muru's user avatar
  • 24.8k
11 votes

vim hangs when I open a typescript file

From :help 're': *'regexpengine'* *'re'* 'regexpengine' 're' number (default 0) global This selects the default regexp engine. |two-engines| The possible ...
D. Ben Knoble's user avatar
  • 25.8k
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
Naumann's user avatar
  • 2,759
10 votes

Easiest way to insert LaTeX matrix?

Honza's UltiSnips Snippet gentbl<number>x<number> available in the repository https://github.com/honza/vim-snippets/blob/master/UltiSnips/tex.snippets Using this snippet which uses the ...
Hotschke's user avatar
  • 4,740
10 votes
Accepted

Auto back-indent word 'else' in if/else statement in Vim

Let's start from the beginning. There are quite a few (local to buffer) options in Vim to work with indenting. autoindent is the most basic setting; it simply makes a new line to have an equivalent ...
Matt's user avatar
  • 20.6k
9 votes

How to conditionally load plugins

Instead of calling execute pathogen#infect() to load all plugins, call pathogen#interpose for every plugin, i.e.: execute pathogen#interpose('bundle/unicode.vim') execute pathogen#interpose('bundle/...
Martin Tournoij's user avatar
9 votes

How to see if a plugin is active

One way is to do a regex search on runtimepath: if match(&runtimepath, 'MY-PLUGIN') != -1 " ... endif If you're using vim-plug, here's a general purpose method to check: function! ...
Mateen Ulhaq's user avatar
9 votes
Accepted

Drawbacks of using Python to develop new code in a VIM plugin

TL;DR: Requiring +python/+python3 support for a python based development plugin. That sounds completely reasonable. About Vim plugins and human behavior Generally, speaking humans want things to ...
Peter Rincker's user avatar
8 votes

Gundo plugin requires python 2.4 when version 2.7 is installed

Try the undotree plugin: Someone asked me about the difference with Gundo, here is a list of differences, or advantages. Pure vimscript implementation and no 3rd-party libraries(like ...
mMontu's user avatar
  • 6,610
8 votes

How do I install a .vimball Plugin?

:UseVimball path instead of :so [name].vba for vim8-packages/dein/vim-plug/minpac If you use vim8 pack paths or a plugin manager which supports local plugins (e.g. dein or vim-plug), you might want ...
Hotschke's user avatar
  • 4,740
8 votes

How to see if a plugin is active

If you use vim-plug, it sets a variable called plugs which lists all your loaded plugins, and some information about them. I solved your question for myself when I needed to check whether I was ...
Max Coplan's user avatar
8 votes
Accepted

How to identify all the loaded ftplugins for the current file?

I don't know of a direct way to get a list of only the things loaded for the current buffer based on filetype, but :scriptnames will list everything that's been loaded, including system/default ...
Jim Stewart's user avatar
8 votes
Accepted

Why do plugins check v:version < 700?

v:version specifies your current version of Vim. Version 7.0 has version 700, 7.2 has version 702, etc. Now, version 7 was a very major release with many enhancements to the previous release 6, that ...
Christian Brabandt's user avatar
7 votes

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

Extending on muru's answer, you could inspect the code, specially as the plugin code is usually very short (the exceptions are some popular plugins, but by being popular they are safer -- you can ...
mMontu's user avatar
  • 6,610
7 votes
Accepted

How to update vim plugins with pathogen package manager?

pathogen manages the run time path of Vim. It is not the same as vim-plug nor vundle. The differences between the vim plugin managers has many good answers. :-) How to use Tim Pope's Pathogen ...
StandardEyre's user avatar
  • 1,118
7 votes

How to see if a plugin is active

Vim plugins don't come with any activation indication, and in a proper setup, this isn't necessary. You can quickly check whether a plugin is active by querying for its side effects, typically ...
Ingo Karkat's user avatar
  • 17.8k
7 votes

Call function only when the plugin is loaded

Rather than have my ~/.vimrc load a plugin ahead of when it would normally be loaded, I usually solve this problem in one of two ways. Call the function in a ~/.vimrc/after/plugin/MyPlugin.vim file. ...
garyjohn's user avatar
  • 6,299

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