Great, and, just to put my further discoveries here:
In order to avoid reimplementing or breaking other tabbing behavior, I should probably make my plugin keep a setting describing when it is active. For example, it could be active in C++ or Java scopes only. I can also make a command within my plugin to return whether the plugin should be given the current point or selection. Using that command, I would add something like this to the keymap:
[code] { “keys”: “tab”], “command”: “indent_to_column”, “context”:
{ "key": "should_indent_to_column", "operator": "equal", "operand": true },
]
}[/code]
The should_indent_to_column command checks whether I’m in the right scope. The indent to column command always indents selected lines to the correct column. This won’t behave quite right when there are parts of a region that are inside parens and parts outside. For that I’d want to apply my specialized indenting behavior to one part and the ordinary indenting behavior to the other. But for that I suspect we would need some more unified view of auto-formatting than I think we have available at the moment.