-
Notifications
You must be signed in to change notification settings - Fork 1
completion
<!-- vim: set filetype=markdown: -->
When a wheel function needs to prompt the user for input, it offers completion wherever possible. The completion type depends of course on the nature of the asked entry :
- location, circle or torus
- file, directory, buffer
- tag
- and so on
Hitting 'wildchar'
(most likely <tab>
), will trigger the completion.
If pum
is in wildoptions
, the choices will be displayed in a nice
pop-up menu.
You can enter one or more patterns before hitting 'wildchar'
to narrow
the completion list :
- a space between two patterns is a logical and. So,
one two
will display candidates containing bothone
andtwo
- a pipe
|
between two patterns is a logical or. So,one|two
will display candidates containingone
ortwo
- a bang
!
beginning a filtering pattern is a logical not : all candidates matching this pattern will be removed from the list
Here, one
and two
can be any vim regex. Most of the time, they are
simply litteral parts of the wanted result.
For example, if you have the completion list small flower
, big flower
,
small fruit
and big fruit
:
- the pattern
fl
will narrow down tosmall flower
,big flower
- the pattern
sm
will narrow down tosmall flower
,small fruit
- the patterns
sm fl
will narrow down tosmall flower
- the patterns
all !ower
will narrow down tosmall fruit
- the patterns
al|owe
will narrow down tosmall flower
,small fruit
,big flower
All builtin patterns remain available.
If you want a classic completion matching only at the beginning of the
string, you can use ^
. For example, if you have the completion list
small flower
, sunflower
, flower
, small fruit
, big fruit
and
fruit
:
- the pattern
^f
will narrow down toflower
,fruit
- the pattern
^s
will narrow down tosmall flower
,sunflower
,small fruit
If g:wheel_config.completion.vocalize
is greater than 0, the plugin adds
vowels patterns between the chars you enter, to enable a kind of vowels-fuzzy
completion.
This way, if you have the completion list profile
, proof
, wheel
and organize
:
- the pattern
prf
will narrow down toprofile
,proof
- the pattern
hl
will narrow down towheel
- the pattern
gn
will narrow down toorganize
Kind of a step between classic & full fuzzy completion.
If g:wheel_config.completion.wordize
is greater than 0, the plugin
adds word-characterss patterns between the chars you enter, to enable
a kind of word-fuzzy completion.
This way, if you have the completion list profile
, proof
, wheel
and organize
:
- the pattern
pof
will narrow down toprofile
,proof
- the pattern
we
will narrow down towheel
- the pattern
oai
will narrow down toorganize
If g:wheel_config.completion.scores
is greater than 0, scores are computed,
and matching results are sorted accordingly.
If g:wheel_config.completion.fuzzy
is greater than 0, a full fuzzy
completion is enabled, using matchfuzzy()
. Beware that the or |
operator
is not available in this mode.
Files and directories completes in different ways depending on the beginning fo your input :
Beginning of input | Completion list | Pattern(s) |
---|---|---|
./ | files and subdirs in current directory | single |
../ | files and subdirs in parent directory | single |
/ | files and subdirs in root directory | single |
~ or ~/ | files and subdirs in home directory | single |
anything else | current directory tree, recursive | multi |