Vim XMLns context awareness
I've used Vim's g:xmldata_
to describe XML possible elements to be able to use omni-compete for XML. The problem is not each A
node has a0
, a1
, an
. S开发者_JAVA技巧ometimes A
node has only a0
. And the documentation of
the a0
and A
is different and depends on parent of A
.
E
|
|--A
| \-a0 // documentation of E.A.a0
| \-a1
|
\--B
\-A
\-a0 // documentation of E.B.A.a0
Documentations of A and a0 are different. But user will see the same help-text in the complete preview window.
Here is the test xmldata to play with. Put this
let g:xmldata_test = {
\ 'vimxmlroot': ['E'],
\ 'E': [['A', 'B']],
\ 'B': [['A']],
\ 'A': [['a0', 'a1']],
\ 'vimxmltaginfo': {
\ 'a0': ['', 'documentation that only confuses an user'] }}
in autoload/xml/test.vim
And execute while edit some xml document:XMLns test
To bring up the complete window just type < and press C-X C-O
Is there any way to tell Vim for which a0
I want to set help information?
精彩评论