Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
74

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 defined like this: A Vim package is a directory that contains one or more plugins. This means that the new package manager was created to help users manage all ...


66

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.) (What makes a plugin Vundle compatible and are other plugin managers interchangeable?) A single .vim file is supposed to be placed in the .vim/plugin directory. ...


38

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 different directories, you have to manually find them & remove them. Upgrading problems is similarly difficult: What if autoload/old-name.vim gets renamed to ...


25

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, vundle, neobundle etc, it's become more of an easier approach to upgrading the plugins. You can also more easily control which release you would like to lock ...


25

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\vimfiles. Copy pathogen.vim to ~/.vim/autoload/pathogen.vim. Create the ~/.vim/bundle directory, if it does not exist already. Add the following line to the very ...


24

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 documentation: A Vim package is a directory that contains one or more plugins A package directory contains two sub-directories: start/ - contains plugins ...


24

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


23

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') Plug 'embear/vim-localvimrc' Plug 'kchmck/vim-coffee-script' " ... etc call plug#end() Then restart Vim, and then install plugins with: :PlugInstall Or, ...


20

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/mystuff.vim (the name of the file doesn't matter) should allow you to override the plugin mapping.


19

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 your vimrc file: autocmd VimEnter * noremap <leader>cc echo "my purpose" From :help VimEnter: VimEnter: After doing all the startup stuff, including ...


18

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 keep track of. The git site has an introduction to submodules. The basic idea is to keep a reference to another git repository associated with a path on your ...


18

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 :set filetype whatever instead of set syntax whatever to enable the plugin. (Some other plugin manager might allow you to do that, see What is the difference ...


17

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 if the plugin was loaded, as it is recommended practice to allow the user to disable the loading of a given plugin.. You usually can find g:loaded_... variable ...


16

To answer youre 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 have to write it like this: let @x = call(a:functionToExecute, [GetSelectedText()]) This assumes a:functionToExecute is either a Funcref (see :help Funcref),...


16

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 not reading .vimrc file and -U NONE for not reading a .gvimrc file) or even plugin. After opening Vim/gVim you can use :source <path> to load a test ...


14

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! -nargs=0 Sw w !sudo tee % > /dev/null


14

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 manage addons that are distributed in the form of Debian packages. There are people that prefer, for various reason, to use packaged software even for things like ...


12

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 you can do is enable profiling (see :help profiling) and see which functions take the most time to run, but that won't tell you much about either CPU or memory ...


12

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) Updating plugins (using :PluginUpdate) Managing the plugin load path in the .vimrc (simply comment out plugin entries you don't want to load) Removing plugins you ...


11

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 directory to group related plugins. E.g. "Syntax" or "Ruby". The relevant bash example is below. Place in a file and run it. Additional discussion around the ...


11

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 insert mode (i), then it works as a terminal, the cursor goes to 'stage this hunk...' line. Long Answer: Don't use p! If you're already using plugin-fugitive, ...


10

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 ~/.vim/autoload/... ~/.vim/bundle/pluginname/autoload/... /doc/... /doc/... /ftplugin/... ...


9

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 your ~/.vim directory. You can delete it after you have sourced the vimball file


9

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 little bit of per-filetype configuration, the :dlist command could be used to list every function in the current file and included files: :dlist / See :help ...


9

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 appear simple and "just work". When it comes to Vim plugins, Vimmers typically want plugins with no or very few dependencies. Basically it should be as simple as ...


8

Unpack the plugin into ~/.vim/ide_support then add the following to your .vimrc. set runtimepath+=~/.vim/ide_support Vim will now look in ~/.vim/ide_support for plugins. This is one of the things that a plugin manager such as pathogen does for you automatically.


8

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, Python, Ruby or Lua programs. So malware written in any of these that makes use of only standard libraries could be embedded in Vim. Even if neither of these were ...


8

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/AnsiEsc.vim') The pathogen API isn't documented outside of the source, but it's simple enough (even though the function names are obscure and non-descriptive). ...


8

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 plugins, runtime scripts, etc. To figure out what's additionally autoloaded for a specific filetype, start Vim with no arguments, run :scriptnames, then open a file ...


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