Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim movements: going to parent

Tags:

vim

In Vim, how can I move to parent/cousine tags in xml files? I'm looking for something similar to:

vatat " create a selection for second parent tag with all child elements

but in normal mode (eg: go to second parent tag).

like image 950
Robert Zaremba Avatar asked May 29 '11 18:05

Robert Zaremba


1 Answers

Do you want a way to "move" using any text-object motion or just the specific example you've given. For the first one, just use v at the end

vatatv

(you can also use o in visual mode, to go to the begining/end of the selection)

If you want a mapping just do (to use ]t and [t)

 nnoremap ]t vatatv
 nnoremap [t vatatov

or something similar

like image 141
mb14 Avatar answered Nov 16 '22 01:11

mb14