Questions tagged [plugin-system]

For questions about Vim's plugin system. NOT for questions about a specific plugin (use the appropriate plugin-* tag) or questions that may require a plugin.

Filter by
Sorted by
Tagged with
143 votes
7 answers
196k views

How do I install a plugin in Vim/vi?

How do I install a plugin in Vim? Does it matter: Whether I use vi or Vim? Whether I use gVim? Which version of Vim I'm using? What my OS is?
elyashiv's user avatar
  • 2,429
152 votes
4 answers
54k views

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

Vim 8 was released today and the release notes mentions a new "package" feature. What is it and how should I use it? Most importantly, does it replace the good old plugin managers?
statox's user avatar
  • 49.8k
4 votes
1 answer
2k views

How to load plugins from my vimrc and from another file?

I have my dotfiles synchronized on github which is a current practice. As I use several machines I want to be able to have some part of my configuration not synched on my github repo. To do so I ...
statox's user avatar
  • 49.8k
31 votes
3 answers
10k views

How can I redefine plugin key mappings?

I have installed a plugin that doesn't provide a mechanism to disable the key mappings it defines. I want to redefine one of the mappings (<leader>cc) defined by the plugin for my own pursope, I'...
toro2k's user avatar
  • 4,892
1 vote
2 answers
2k views

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

There is this feature or module in Vim which auto back-indents words during writing if/else statements. For example: if a == 1: xx <-- here when I press enter cursor goes right below end of ...
user1880405's user avatar
7 votes
1 answer
952 views

How to customize colorschemes without editing their source files?

Similarly to plug-ins, color schemes are commonly distributed as clone-able Git repositories, which make it less desirable to directly edit their source files (as sometimes suggested) when wanting to ...
PiCTo's user avatar
  • 349
7 votes
1 answer
4k views

In what order does vim read ftplugin files, syntax files, and the .vimrc when `filetype plugin on` and `set syntax=filetype` are called?

I've had some issues reconciling my .vimrc with files in ftplugin and after/ftplugin. In what order are they all read? For example: When vim encounters the line plugin filetype on in a .vimrc file, is ...
Luke Davis's user avatar
  • 1,397
26 votes
5 answers
2k views

GitHub for .vimrc and plugins

I know many people store their .vimrc on GitHub to make it easier to get right to work on new machines, and that makes complete sense to me. Including plugins, however, is problematic, because the ...
Tom's user avatar
  • 1,240
11 votes
1 answer
3k views

how to load vim8 optional packages in vimrc?

I am trying to load my optional language packages based on filetype. I am using vim8 native package feature. In vim I can load them with :packadd vim-javascript. However, I read in :help packadd - (...
The Fool's user avatar
  • 221
9 votes
3 answers
2k views

Elegant way to support both python and python3 in vim plugin

I recently received a pull request to change my vim plugin to make it support python3. But these changes break the plugin for the vim on my Mac which seems to listen to python. python import sys ...
mipmip's user avatar
  • 191
5 votes
2 answers
2k views

Easiest way to insert LaTeX matrix?

Recently I found myself in a situation that need to type in quite a number of matrices to LaTeX by hand, so I was wondering if there are some tools that can help me to save some keystrokes. The ...
hzh's user avatar
  • 195
2 votes
1 answer
690 views

Installing NeoBundle packages with Plug

I have a plugin that only has install instructions for NeoBundle. I primarily use Plug, however. I tried copying the GitHub path from the NeoBundle instructions to a Plug command considering the two ...
amyiris's user avatar
  • 23
23 votes
6 answers
28k views

How to see if a plugin is active

How can I determine if a filetype plugin (such as vim-latexsuite) has been installed and activated when I open the appropriate file? Another popular editor would indicate that the relevant "minor mode"...
SabreWolfy's user avatar
21 votes
1 answer
674 views

Figure out which plugin is responsible for a key binding

I was about to answer a question but realized that my answer depends on a key binding provided by a plugin I have installed. Even worse, I don't know which plugin provides it. The only way I know to ...
Praxeolitic's user avatar
  • 2,478
19 votes
2 answers
8k views

How to conditionally load plugins

I was searching for an answer to this, but haven't found anything yet, so if I missed something obvious, I apologize. I thought it would be a quick google search away, so maybe it's more complicated ...
Hoopes's user avatar
  • 305
17 votes
2 answers
4k views

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

For a long time now I've been using Vundle to manage my vim plugins. As best I can make out this basically just organizes plugins in an isolated directory structure and keeps track of updating them ...
Caleb's user avatar
  • 2,245
17 votes
1 answer
2k views

What is a Vim plugin?

I understand that we can extend the power of Vim in order to add new features or modify existing ones and enhance our editing experience. Although being myself a Vim user for quite a long time, I am ...
Paulo Cereda's user avatar
16 votes
2 answers
2k views

Detect most resource hungry plugin

I have some plugins installed for vim, I would like to know how can I find out what plugin uses most resources (CPU, RAM) ?
JaDogg's user avatar
  • 417
14 votes
2 answers
3k views

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

I am trying to create a small plugin to learn vimscript, my goal is to create some functions processing a selected text and replacing it with the result. The script contains the following items: Two ...
statox's user avatar
  • 49.8k
13 votes
2 answers
7k views

How do I install a .vimball Plugin?

I was given a plugin for Vim. It came in something called a .vimball. What am I meant to do with this exactly? Where do I put it? Do I need to be root to install it?
Frames Catherine White's user avatar
10 votes
1 answer
902 views

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

On Debian based systems, there is a package named vim-addon-manager. My understanding is that it allows to install some plugins based on a repository of available plugins. To be able to install them, ...
statox's user avatar
  • 49.8k
9 votes
2 answers
2k views

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

In one of the vim plugins I use, we have been thinking about using python vs vimscript going forward (https://github.com/python-mode/python-mode/issues/813#issuecomment-344754563). I understand that ...
alpha_989's user avatar
  • 901
7 votes
1 answer
1k views

How can I prevent plugins from overwriting my key mappings?

In my vimrc I have: nnoremap <F4> :SyntasticToggleMode<CR> And this works. But I also have the unicode.vim plugin installed, which overrides this mapping: if !hasmapto('<Plug>(...
Martin Tournoij's user avatar
5 votes
1 answer
5k views

Using vim-addon-manager

I just downloaded and installed vim-addon-manager using sudo apt-get install. I'm not sure what to do next, I entered vim-addon-manager at the bash prompt (Ubuntu 14.04). Here is the output: ~$ vim-...
gracious1's user avatar
  • 283
4 votes
1 answer
2k views

Vim zebra line coloring?

Is there a plugin or way for me to alternate the background color for each line in vim? E.g. Previously I'd found vim-zebra but this looks really ugly: I'd prefer the whole line to be colored, not ...
minseong's user avatar
  • 2,323
4 votes
1 answer
2k views

Call vim command from shell, and suppress output while it operates

I'm setting up a vim environment install script. I'm using vim-plug for plugin management. What I'd like to do is, from the install.sh, run vim and call PlugInstall to trigger plugin download and ...
silico-biomancer's user avatar
4 votes
3 answers
5k views

Call function only when the plugin is loaded

I use Plug as my plugin manager and have this line: Plug 'MyPlugin', { 'for' : 'c'} which means it should only load the plugin MyPlugin when a file of the filetype c is opened. This works fine, but ...
Angry Red Panda's user avatar
3 votes
3 answers
2k views

How do I prevent Vim from loading plugins on older configurations?

I have a couple of plugins that don't work correctly on some machines running earlier versions of Vim. Is there a way to supress the Error detected while processing... errors when I start up vim in ...
Shawn Conn's user avatar
3 votes
1 answer
1k views

Order in runtimepath of Vim packages or similar plug-in managers

Vim packages work by updating 'runtimepath' to include the top directories of the plug-ins in each package (and also the after/ directory), but the Vim documentation on packages isn't absolutely clear ...
filbranden's user avatar
  • 28.8k
3 votes
2 answers
1k views

Selectively enable a subset of vim plugins for specific category of workflows (plugin virtualenv for vim projects)

I use vim for many different categories of projects, typically: Writing code (3 languages, python, Matlab and C) Writing documentation ( .rst, .html) Writing reports (.tex) Readme file (.md) As a ...
Dr Krishnakumar Gopalakrishnan's user avatar
2 votes
1 answer
1k views

Is there Vim plugin that can show keystroke maps or abbreviations for command after it is used?

Is there a tool or plugin for a learner which can display the keyboard shortcuts or abbreviated versions for commands after they are typed in? If for instance I use : to get the command line and ...
vfclists's user avatar
  • 907
2 votes
1 answer
591 views

How can I right-align end-of-line comments with the Tabular plugin?

I often have code that looks something like this: a = 1 # description 1 longer_name = 2 # description 2 # no_longer_needed = 3 # ignore another_name = 4 # description 4 and would like to right-align ...
Luke Davis's user avatar
  • 1,397
1 vote
2 answers
124 views

How do I let the user of my plugin customize a custom highlight group I define?

In this plugin for (soft-)wrapping only the current line, I have defined a highlight group, au ColorScheme * hi SoftWrapHighlightGroup ctermbg=NONE ctermfg=NONE, which I use here as an argument to a ...
Enlico's user avatar
  • 2,194
1 vote
1 answer
553 views

When to use "set exrc" and local '.vimrc' in Vim, and how to manage plugins with multiple 'vimrc' files for large projects?

I'm using Vim for a project that has a lot of pages per chapter, and Vim is a little bit slow. I want to create a local '.vimrc' file for this project with only the plugins I need, and I'm trying to ...
Mafsi's user avatar
  • 225
1 vote
1 answer
333 views

Syntax folder under plugin/foo/syntax/foo.vim not automatically applied when filetype change?

I have a plugin under nvim/plugin/foo, but the syntax file nvim/plugin/foo/syntax/foo.vim is not automatically applied when the filetype change, but if I put it under nvim/syntax/foo.vim it works I'...
tga's user avatar
  • 419
1 vote
2 answers
577 views

How to autoload multiple rc-style files in Vim 8+

I want to split up my .vimrc into multiple files by language or toolchain, use case, etc. In fact, my end goal is to be able to provide instructions to students in the format of "If you want the ...
coolaj86's user avatar
  • 135
0 votes
2 answers
113 views

How can I check whether the user has defined a highlight group before Vim 8.2.3917

With this question I've learned of the existence of hlget and hlID, which I use in a plugin of mine like this: if empty(hlget('SoftWrapHighlightGroup')) " do stuff endif However, those ...
Enlico's user avatar
  • 2,194