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 ...
41
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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. ...
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 ...
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 ...
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, ...
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
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 ...
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 ...
10
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 ...
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/...
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 ...
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 ...
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 ...
8
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! ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
plugin-system × 218vimrc × 39
vimscript × 26
neovim × 22
key-bindings × 16
plugin-vim-plug × 12
filetype × 9
syntax-highlighting × 8
microsoft-windows × 7
packages × 7
vimscript-python × 6
gvim × 5
autocmd × 5
autocompletion × 5
colorscheme × 5
plugin-managers × 5
buffers × 4
vim-windows × 4
functions × 4
invocation × 4
command-line × 3
highlight × 3
plugin-nerdtree × 3
help-system × 3
error × 3