vim xml folding/unfolding siblings of current element

419 views
Skip to first unread message

russur...@verizon.net

unread,
Nov 7, 2011, 12:38:05 PM11/7/11
to vim...@googlegroups.com

I have the folding set for vim when i edit xml files. It's all folded into one fold. That's fine. I like to be able to get a view of the elements that make up the current element. Can i unfold only those siblings contained in the current element, and vice versa?

thanks,


Russ

Ben Fritz

unread,
Nov 8, 2011, 11:37:34 AM11/8/11
to vim_use


On Nov 7, 11:38 am, russurquha...@verizon.net wrote:
> I have the folding set for vim when i edit xml files. It's all folded into one fold. That's fine. I like to be able to get a view of the elements that make up the current element. Can i unfold only those siblings contained in the current element, and vice versa?
>

I'm not clear on exactly what you want, but I think one of the
following will work:

1.
zM
move/zo until you have the view you want (or maybe just hit zv)

2.
zM
move/zo until you find the parent element (or hit zv, go to parent,
and close it with zc)
zO to open the parent element and all descendants

Russell Urquhart

unread,
Nov 8, 2011, 10:11:44 PM11/8/11
to vim...@googlegroups.com
Thanks for your reply.

I kind of had a DOH moment there and figured out what i needed.

Seems that, when i load the xml.vim file, and have the fold method set to syntax, that is what i need.

I had been doing a zA, to open everything, turns out that instead of doing that, if i had did zo, that does EXACTLY what i need!

Thanks for your help and time. Sorry i was so stupid!


Russ

> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

Reply all
Reply to author
Forward
0 new messages