The sqlcompletion and syntaxcompletion plugins are available with Vim70d.
They both return Lists with the required data.
I would like to add additional information by returning a Dictionary
instead, so the OMNI preview window contains useful information.
The syntax plugin retrieves the syntax items via the :syntax list command.
This is redirected into a variable and then some regex's are run against it.
The net result is a space separate list of syntax items.
"from begin end select"
Then typically I create a list, sort it and return it to the user via the
omni completion popup:
let compl_list = sort(split(syn_list))
I was wondering if there was an easy way to convert:
"from begin end select"
Into a Dictionary something like:
{'word':'from', 'menu':'from', 'kind':'f', 'info':'sqlKeyword'}
{'word':'begin', 'menu':'begin', 'kind':'f',
'info':'sqlKeyword'}
{'word':'end', 'menu':'end', 'kind':'f', 'info':'sqlKeyword'}
{'word':'select', 'menu':'select', 'kind':'f',
'info':'sqlKeyword'}
Reading through the help and the functions available, I didn't see any.
Will I have to perform a brute force technique and use a for each loop? I
am looking for alternatives since the sqlcompletion plugin often does not
have control over the format it will receive the data in, so I am trying to
be as flexible as possible.
If I create a List out of Dictionary items, can it still be sorted?
TIA,
Dave