Skip to main content
add link to help, recommendation of plugin manager and explanation of `plugin` directory
Source Link
filbranden
  • 29.9k
  • 5
  • 28
  • 73

The .vim/plugin directory is not where you want to unpack your plug-ins! (Yes, I known the name would suggest so...)

If you want to use Vim 8 packages (which I believe you do), then you should unpack it under a directory named ~/.vim/pack/*/start, where the component after pack can be named anything (suggestions are bundle, vendor or your username.)


See :help packages for more information about Vim packages.

One alternative to Vim packages is to use a Vim plug-in manager to manage your plug-ins (they can load, install and update them.) If you decide to use a plug-in manager, I'd recommend vim-plug, which is simple to install (just download a single file), to configure and to use.


About the ~/.vim/plugin directory, that's a much simpler concept of plug-in and it simply includes Vim script files that are always unconditionally loaded by Vim on startup.

As Vim evolved, the need for Vim scripts that would loaded in different situations arose, and new directories were added for:

  • dynamically loaded Vim scripts, loaded when a function in that namespace is first called (autoload)
  • scripts that are loaded for files of specific types, for example code in specific languages (ftplugin)
  • scripts to detect what the type of a file should be, based on its extension or even file contents (ftdetect)
  • scripts implementing syntax highlighting (syntax) or indentation (indent) for a specific file type.

A "modern" Vim plug-in is in fact a package that will typically include Vim scripts split into one or more of these directories. (In fact, a large part of plug-ins will not even ship anything in the plugin directory, which means they typically don't incur any cost at Vim startup and only get loaded when they're used, either through a filetype or when an autoloaded function is invoked.)

Since the term plugin was already used, Vim 8 decided to call these "packages", but of course the common term for those is still a "Vim plug-in," which unfortunately causes this confusion.

The .vim/plugin directory is not where you want to unpack your plug-ins! (Yes, I known the name would suggest so...)

If you want to use Vim 8 packages (which I believe you do), then you should unpack it under a directory named ~/.vim/pack/*/start, where the component after pack can be named anything (suggestions are bundle, vendor or your username.)

The .vim/plugin directory is not where you want to unpack your plug-ins! (Yes, I known the name would suggest so...)

If you want to use Vim 8 packages (which I believe you do), then you should unpack it under a directory named ~/.vim/pack/*/start, where the component after pack can be named anything (suggestions are bundle, vendor or your username.)


See :help packages for more information about Vim packages.

One alternative to Vim packages is to use a Vim plug-in manager to manage your plug-ins (they can load, install and update them.) If you decide to use a plug-in manager, I'd recommend vim-plug, which is simple to install (just download a single file), to configure and to use.


About the ~/.vim/plugin directory, that's a much simpler concept of plug-in and it simply includes Vim script files that are always unconditionally loaded by Vim on startup.

As Vim evolved, the need for Vim scripts that would loaded in different situations arose, and new directories were added for:

  • dynamically loaded Vim scripts, loaded when a function in that namespace is first called (autoload)
  • scripts that are loaded for files of specific types, for example code in specific languages (ftplugin)
  • scripts to detect what the type of a file should be, based on its extension or even file contents (ftdetect)
  • scripts implementing syntax highlighting (syntax) or indentation (indent) for a specific file type.

A "modern" Vim plug-in is in fact a package that will typically include Vim scripts split into one or more of these directories. (In fact, a large part of plug-ins will not even ship anything in the plugin directory, which means they typically don't incur any cost at Vim startup and only get loaded when they're used, either through a filetype or when an autoloaded function is invoked.)

Since the term plugin was already used, Vim 8 decided to call these "packages", but of course the common term for those is still a "Vim plug-in," which unfortunately causes this confusion.

Source Link
filbranden
  • 29.9k
  • 5
  • 28
  • 73

The .vim/plugin directory is not where you want to unpack your plug-ins! (Yes, I known the name would suggest so...)

If you want to use Vim 8 packages (which I believe you do), then you should unpack it under a directory named ~/.vim/pack/*/start, where the component after pack can be named anything (suggestions are bundle, vendor or your username.)