The Structure of a Vim Plugin
Vim reads VimL files from several different directories under its home directory, which will be kept in your user directory. On OS X and Linux it looks for these directories under .vim/; on Windows they live in a directory called vimfiles.
-
plugin: This is the main directory for plugin script files. A Vim plugin can be as small as a single file that lives in this directory.
-
autoload: The autoload directory stores VimL script files that are loaded on demand. You’ll learn about Vim’s autoload system in Chapter 3, The Autoload System.
-
ftdetect: This is where we place VimL files that detect the type of file Vim is editing.
-
ftplugin: Almost like plugin, this directory is used mainly by filetype plugins. The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access