Lines Matching refs:plugin

22 |41.11|	Writing a plugin
23 |41.12| Writing a filetype plugin
24 |41.13| Writing a compiler plugin
25 |41.14| Writing a plugin that loads quickly
1974 *41.11* Writing a plugin *write-plugin*
1977 called a plugin. Vim users can drop your script in their plugin directory and
1978 use its features right away |add-plugin|.
1987 section |write-filetype-plugin|.
1992 First of all you must choose a name for your plugin. The features provided
1993 by the plugin should be clear from its name. And it should be unlikely that
1994 someone else writes a plugin with the same name but which does something
2001 For the plugin to work for everybody, it should follow a few guidelines. This
2002 will be explained step-by-step. The complete example plugin is at the end.
2007 Let's start with the body of the plugin, the lines that do the actual work: >
2019 in your plugin file!
2024 You will probably add new corrections to the plugin and soon have several
2026 know who wrote this wonderful plugin and where they can send remarks.
2027 Therefore, put a header at the top of your plugin: >
2029 1 " Vim global plugin for correcting typing mistakes
2034 worth restricting their distribution, please consider making your plugin
2036 the top of the plugin should be sufficient. Example: >
2057 the end of the plugin this value is restored.
2066 It's possible that a user doesn't always want to load this plugin. Or the
2067 system administrator has dropped it in the system-wide plugin directory, but a
2068 user has his own plugin he wants to use. Then the user must have a chance to
2069 disable loading this specific plugin. This will make it possible: >
2081 plugin, literally. The "g:" is prepended just to avoid mistakes when using
2091 Now let's make the plugin more interesting: We will add a mapping that adds a
2094 allow the user to define which keys a mapping in a plugin uses, the <Leader>
2151 the current script. In our typing correction plugin we use it like this: >
2169 This is a bit complicated, but it's required for the plugin to work together
2179 recommended. For example, "Plugin.CVS" could be used for a plugin that offers
2259 1 " Vim global plugin for correcting typing mistakes
2318 It's a good idea to also write some documentation for your plugin. Especially
2322 Here is a simple example for a plugin help file, called "typecorr.txt": >
2326 3 If you make typing mistakes, this plugin will have them corrected
2340 17 This plugin doesn't have any settings.
2349 existing help tags. You would probably use the name of your plugin in most of
2356 FILETYPE DETECTION *plugin-filetype*
2374 SUMMARY *plugin-special*
2376 Summary of special things to use in a plugin:
2387 keys that plugin mappings start with.
2397 *41.12* Writing a filetype plugin *write-filetype-plugin* *ftplugin*
2399 A filetype plugin is like a global plugin, except that it sets options and
2400 defines mappings for the current buffer only. See |add-filetype-plugin| for
2401 how this type of plugin is used.
2405 here. The essential thing is that a filetype plugin should only have an
2411 If you are writing a filetype plugin to be used by many people, they need a
2412 chance to disable loading it. Put this at the top of the plugin: >
2420 This also needs to be used to avoid that the same plugin is executed twice for
2423 Now users can disable loading the default plugin completely by making a
2424 filetype plugin with only this line: >
2428 This does require that the filetype plugin directory comes before $VIMRUNTIME
2431 If you do want to use the default plugin, but overrule one of the settings,
2438 "~/.vim/after/ftplugin/vim.vim". Note that the default plugin will have set
2444 To make sure the filetype plugin only affects the current buffer use the >
2451 and that is not what a filetype plugin should do.
2468 An example of how to define functionality in a filetype plugin: >
2476 <Plug>JavaImport;. If not, then the filetype plugin defines the default
2478 the key(s) he wants filetype plugin mappings to start with. The default is a
2486 The user must have a chance to disable the mappings in a filetype plugin,
2488 plugin for the mail filetype: >
2516 A filetype plugin will be sourced for each buffer of the type it's for. Local
2524 plugin will be sourced every time a file with this filetype will be opened.
2538 undo the settings in your filetype plugin. Example: >
2567 Summary of special things to use in a filetype plugin:
2570 the keys that filetype plugin mappings start with.
2583 Also see |plugin-special|, the special things used for all plugins.
2586 *41.13* Writing a compiler plugin *write-compiler-plugin*
2588 A compiler plugin sets options for use with a specific compiler. The user can
2597 Use |:next| to go to the next plugin file.
2613 older Vim versions don't, thus your plugin should define it then. This is an
2622 When you write a compiler plugin for the Vim distribution or for a system-wide
2624 "current_compiler" was already set by a user plugin nothing will be done.
2626 When you write a compiler plugin to overrule settings from a default plugin,
2627 don't check "current_compiler". This plugin is supposed to be loaded
2632 *41.14* Writing a plugin that loads quickly *write-plugin-quickload*
2634 A plugin may grow and become quite long. The startup delay may become
2635 noticeable, while you hardly ever use the plugin. Then it's time for a
2636 quickload plugin.
2638 The basic idea is that the plugin is loaded twice. The first time user
2652 " Vim global plugin for demonstrating quick loading
2684 If you drop this script in your plugin directory Vim will execute it on
2704 |FuncUndefined| autocommand. You must make sure that no other plugin defines