I want to navigate between the lines of a file based on indentation. The file is structured by indentation: a line that's more indented than the previous line is a child of the previous line, a line that has the same indentation as the previous line is its sibling. I'm mostly looking for three commands:
- Move to the next sibling, i.e. the next line with the same indentation, skipping lines that are more indented, but not skipping past a line that is less indented.
- Move to the previous sibling, i.e. the same thing in the other direction.
- Move to the parent, i.e. to the previous line with less indentation.
The column position of the point should not change.
These are analogs for indentation-structured data to
backward-up-list for sexp-structured data. Indentation corresponds to program structure in languages such as Haskell and Python; these functions can be especially useful in this context but I am not looking for anything mode-specific (my primary use case is intendation-structured data inside another file format).
http://emacs.stackexchange.com/questions/3372/coloring-indentation-levelsColoring indentation levels can help to navigate manually with Up/Down but I want something automatic.
This super user question is similar but with weaker requirements and does not currently have answers that meet my requirements.