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
152 votes
4 answers
52k 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.3k
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
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,822
25 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,230
23 votes
6 answers
27k 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
23 votes
6 answers
14k views

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

It's really frustrating when I need to edit a file as root and use sudo vim somefile.conf and I can't use any of my keybindings and settings and plugins. Is there a way to get all my customizations ...
Robbie Wxyz's user avatar
22 votes
1 answer
751 views

Why aren't Vimballs commonly used?

I have seen that a lot of Vim Plug-ins don't seem to have Vimballs. Vimballs were/are basically a tarball for a plugin that vim knows how to install. They were/are thus slightly more convenient that ...
Frames Catherine White's user avatar
21 votes
2 answers
4k views

How to patch add in Fugitive plugin?

This screen I got after running the :Gstatus command: Then I moved the cursor to init.vim file and pressed the p key, i.e. run git add –patch for the current file. Now I have this screen: As you can ...
megas's user avatar
  • 389
21 votes
1 answer
582 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,438
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
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
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,235
15 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) ?
bhathiya-perera's user avatar
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.3k
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
12 votes
2 answers
3k views

vim hangs when I open a typescript file

I have a vim 8.2 on a Gentoo Linux running on a more or less 8 years old PC. I almost never have a performance issue with vim, unless you open a one-line huge xml oder json file, but those are vary ...
Pablo's user avatar
  • 251
11 votes
2 answers
1k views

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

I do not know if this question should be asked here or not. In almost every language, malware exists. Is the same also applicable for vimscript? Suppose vim is running with high system privileges. Is ...
Cylian's user avatar
  • 539
11 votes
1 answer
348 views

Experimenting with vim/gvim in "virgin" mode

Sometimes, I would like to try a trick I find in the internet. It is often helpful to try this in vim (gvim if it is a gui trick), in virgin mode, i.e., without loading all my ~/.vimrc stuff. Do you ...
Yossi Gil's user avatar
  • 755
11 votes
2 answers
3k views

Gundo plugin requires python 2.4 when version 2.7 is installed

I have Python 2.7.9 installed. And now I get the message that the Gundo plugin requires 2.4. Is there a workaround? Here is my vimrc file: set nocompatible " be iMproved, required ...
user3467407's user avatar
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
11 votes
3 answers
3k views

Setting syntax in ftplugin

I’m trying to set the syntax of Processing files (*.pde) to java with a ftplugin. .vim/ after/ ftdetect/ pde.vim ftplugin/ processing.vim In after/ftdetect/pde.vim I ...
smeikx's user avatar
  • 113
10 votes
1 answer
882 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.3k
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
  • 881
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
9 votes
3 answers
7k views

Summary of functions in current file?

While working in various source files, (C, Ruby, etc.) I find that I'm often hunting around for functions. Is there a way to have an auto-generated HUD that lists the structure of the current file? It ...
Sauce McBoss's user avatar
9 votes
2 answers
4k views

In my vimrc how to test if a plugin is installed?

My use case is the following, but I think a general solution, working for as many plugins as possible would be preferable: I use the submodes plugin to create a submode handling windows. In my .vimrc ...
statox's user avatar
  • 49.3k
8 votes
2 answers
2k views

How to design a command in a plugin that can be called from vimrc?

I'm working on a plugin that allows users to create custom operators. The operators would apply a VimL expression to the motion or text object that the operator moves over. Keeping a clean user ...
tommcdo's user avatar
  • 7,620
7 votes
1 answer
1k views

Plugin help files not found

I am on windows 10 and installed pathogen into home/vimfiles/autoload, and as far as I know all went well. Following the directions here, I installed nerdcommenter. I restarted gvim, tried :help ...
cumin's user avatar
  • 185
7 votes
1 answer
1k views

Add plugin directory

When I install plugins, I like to keep them organised in folders. For example, I have downloaded plugins that turn vim into a programming IDE. This file contains 16 folders and files which are ...
iProgram's user avatar
  • 1,589
7 votes
1 answer
859 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
  • 359
7 votes
1 answer
203 views

What is the current 'best practice' for persistent preferences for a plugin?

I have a plugin (a unite sub-module) that filters extremely large textfiles down to generate a helpful 'table of contents'. I would like to provide the user with the ability to enable/disable many of ...
jkerian's user avatar
  • 333
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
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
6 votes
2 answers
528 views

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

I have installed a lot of plugins and each may has its own ftplugin settings. What is the way to find out all ftplugin scripts that have been sourced for the current buffer? Just to summarize the ...
doraemon's user avatar
  • 1,667
6 votes
1 answer
3k views

Vim to edit and submit to [Hackerrank]

HackerRank.com allows to solve their own set of programming problems with an online editor wich supports Emacs, Vim and 'Normal' modes. The Vim mode can't really replace a customized local vim and ...
mxlian's user avatar
  • 545
6 votes
0 answers
827 views

Resources for scripting vim with python [closed]

I love vim, I love python, and I dislike vimscript. So I would like to know how to write plugins (or throwaway scripts) for vim in python. Of course, the first reference should be :h python, but I ...
davidlowryduda's user avatar
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
5 votes
2 answers
426 views

Why vim plugins have a check on &cp

I'm trying to wrap my head around vim plugin development and I see a constant check on a variable to see if the plugin has already been loaded like: if exists('g:loaded_plugin') || &cp finish ...
Stoic Alchemist's user avatar
5 votes
1 answer
271 views

Why are inclusion guards used in vim plugins?

I see the following common pattern in the beginning of vim plugins (where NAME is a placeholder for some plugin identifier): if exists("g:loaded_NAME") finish endif let g:loaded_NAME = 1 For ...
dannyadam's user avatar
  • 482
5 votes
1 answer
9k views

How an autoload/file.vim is loaded?

I am on WSL trying to understand why my fakeclip.vim doesn't work. I've added let g:fakeclip_platform = s:PLATFORM into ~/.vim/bundle/vim-fakeclip/autoload/fakeclip.vim, but I can't access the ...
nowox's user avatar
  • 449
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
5 votes
1 answer
821 views

Can I set breakpoint in a vim plugin script written in python?

When a vim plugin is developed in a mixed script of vim script and python, can we set breakpoints and debug the python script. I tried to use PDB module, but vim is dead when it go to the pdb....
ZMJ's user avatar
  • 273
5 votes
1 answer
3k views

Multiple plugin managers [duplicate]

I found out that a plugin I really like doesn't support the plugin manager I like, So the question is, can I use multiple plugin managers at the same time with vim? If so, I think I can use another ...
Iresh Dissanayaka's user avatar
5 votes
0 answers
212 views

Issue when moving Vim9script plugin's functions to autoload

I've read :help write-plugin to understand a bit more about how to write a plugin in Vim9script, but there aspects of that that puzzle me. Here's a very simplified, working version of the example ...
Enlico's user avatar
  • 2,172
5 votes
0 answers
63 views

Is there an ideal / idiomatic way to debug running plugins?

I sometimes have plugs stop working — in my case, mostly using async lookups with Unite. When this happens, I would like to see what is happening and look into how to configure around it, or make a ...
New Alexandria's user avatar
4 votes
4 answers
3k views

How to update vim plugins with pathogen package manager?

I'm searching for a way to update all my vim plugins with pathogen. I see this is simple in other package managers like Neobundle or vundle. Please share a way to update all my plugins without having ...
ArchNoob's user avatar
  • 247
4 votes
3 answers
4k 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
4 votes
2 answers
333 views

Why does Vim load unrelated ftplugins?

When I open a file with .md extension, the filetype is set to markdown, as expected. But the ftplugin for HTML is also loaded as I can see since I have some insert mode mappings in there to auto-...
oarfish's user avatar
  • 1,247
4 votes
2 answers
803 views

Howto enable only one plugin to test?

I need to test a vim plugin. The problem: I already have my vim setup in current env, so ~/.vimrc is occupied. I want to issue a command like vim -u <blah..blah> that maybe specifies the plugin ...
Tuyen Pham's user avatar
  • 1,266
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

1
2 3 4 5