completion - chimay/wheel GitHub Wiki
<!-- 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 twowill display candidates containing bothoneandtwo - a pipe
|between two patterns is a logical or. So,one|twowill display candidates containingoneortwo - 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
flwill narrow down tosmall flower,big flower - the pattern
smwill narrow down tosmall flower,small fruit - the patterns
sm flwill narrow down tosmall flower - the patterns
all !owerwill narrow down tosmall fruit - the patterns
al|owewill 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
^fwill narrow down toflower,fruit - the pattern
^swill 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
prfwill narrow down toprofile,proof - the pattern
hlwill narrow down towheel - the pattern
gnwill 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
pofwill narrow down toprofile,proof - the pattern
wewill narrow down towheel - the pattern
oaiwill 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 |