Justin Pombrio

Tree Editor Commands

Programs are trees, not strings.


Code should be edited using a “tree editor” that respects the syntactic structure of programs, rather than a “text editor” that doesn’t. This is made difficult by the fact that there is a huge amount of infrastructure already in place around text files. Nevertheless, we’ll get there eventually.

Here are some quick thoughts on a grouping of tree editing commands. The cursor will either be around a node in the tree, in which case it refers to the node and all of its children, or it will be ‘editing’ a particular node, in which case you’re manipulating the contents of just that node itself. The “Navigation” directions are relative to the code tree: “up” means “your parent”, and right means “your next sibling”.

Commands

Editing

Kenny & John’s Tree Editor

Here are the commands from a tree editor project at Brown. They are vim-like, and have two modes: normal mode and insert mode.

Commands

Editing