Vimscript is extremely token efficient and very common in training data.
Dunno about constraining to a window, but vimscript itself could be a good way of sending editing commands.