Sublime Forum

Moving between lines which are siblings and parents

#1

Hello,

I have text files where a line is the child of the previous line with less indentation, like this:

  • a
    • b, child of a (because a has less indentation)
      • c, child of b (because b has less indentation)
      • d, child of b (not child of c, because c does not has less indentation)
    • e, child of a (because a is the previous line with less indentation)

The relationship between lines is a little like the ones in YAML obejcts.

But some lines have so much children that it makes it hard to navigate between a line and its siblings.
For example, if the line b have more than 100 children, it is hard to navigate between the children of a, from b to e.

I searched for sublime text commands or plugin to navigate between these lines.
For example, it would be great to have a command to go from the current line

  • to its parent (for example, from d to b)
  • to its previous sibling (for example, from d to c)
  • to its next sibling (for example, from c to d)
    Do you know if they exist?
    If the solution works for JSON and YAML, it is even better!

Also, an other problem, linked to this topic but that may be in its own topic: when the current line is the child of the child of a line with many children, it is hard to get the list of all the parents of the current line.
It would be great that a command of Sublime Text give me the parents of the current line.
For example, on “d, child of b”, sublime text would tell me “a / b, child of a”, wich are the parents of “d, child of b”.
Do you know a way to do it?

Thank you!

0 Likes

#2

You may find something like these plugins useful:

0 Likes