comp.txt Creates custom completion functions
==============================================================================
==============================================================================
This plugin makes creating custom completion functions much easier.
Features:
∙ Ability to get variants from list and from dictionary keys
∙ Ability to get variants from custom function
∙ Allows modifying the completion description
Plugin requires chk, stuf and load plugins.
==============================================================================
This plugin provides only two functions: one that creates completion function
and one that removes it. Both functions are available from dictionary returned
------------------------------------------------------------------------------
All following functions are accessed via dictionary returned by
Create a new completion function. {funcname} must be unique, but its
only purpose is to provide a way to delete last reference to {model}
when plugin is un- or reloaded. See comp-models for description of
{model} argument.
function.
==============================================================================
Completion model is a dictionary that contains required `model' key and some
additional keys depending on the value of the `model' key. Possible models
(`model' key values):
Optional keys: actions :: { {action}: {model} }
Defines a completion for command that looks like this: >
Command action1 some_argument
Command action2 some_argument some_other argument
Command action3
...
<
Each value defines a model for the corresponding key which represents
the action name.
Optional keys: arguments :: [{ListDescription}]
Defines a completion for command that takes a list of arguments, for
each possible arguments a {ListDescription} must be defined. See
Required keys: words :: {ListDescription}
Defines a completion for command that takes a list of arguments that
are not connected with each other, for every argument
for details.
Optional keys: arguments :: [{ListDescription}]
prefix :: { {prefix}: {ListDescription} }
Defines a completion for command that takes a list of arguments,
followed by prefixed arguments. Example: >
Command print columns 3
Command print buffer %
" The following commands are assumed to be equal
Command print buffer % columns 3
Command print columns 3 buffer %
<
`prefix' describes prefixes and corresponding arguments.
Like {model}, but for use in input() completion.
==============================================================================
Argument description is a list that contains two item: first is the type of
description and second is description argument:
Type Argument and description
Take possible variants from the specified list.
Take possible variants from the list of keys of the specified
dictionary.
Take possible variants from the list of files created by zsh-like
completion function. {Argument} restricts file ends to match
{Argument} (case ignored) if there are any matches, otherwise
{Argument} is ignored.
Like file, but resulting file list is filtered through
ignored. For example, argument description ["file", ".txt"] and
["file!", ["regex", '\.txt$']] are just the same, but first version is
faster.
Note that neither file nor file! support filenames that have newline
characters ("\n") (see glob() for more details).
Take possible variants from the returned value of a function provided
as {Argument} called with an only argument: {ArgLead}. This function
must return a list of Strings, all values that are not Strings are
ignored. Note that comp.vim will filter resulting list for you, so you
do not need to care about it.
Merge lists of possible values obtained after processing all
{ListDescription}s.
Process {ListDescription}s given in {Argument}, return first non-empty
list of possible values or empty list if all descriptions gave an
empty list.
vim: ft=help:tw=78