vai icon indicating copy to clipboard operation
vai copied to clipboard

Dynamic objects for verbs

Open syntonym opened this issue 9 years ago • 3 comments

vim commands are implemented in a modular way, most (all?) "commands" do not simply "delete" but can be used to construct "sentences" like "delete line" or "delete word", "delete until next char 'x'". It is intuitiv to think of "verbs" and "nouns".

You can read about text objects here or in the official help

vai currently thas no concept of "nouns" or "verbs" or even "commands". It does have "states" like the "YankState" that basically would have the posibillity to "emulate" that kind of behaviour.

I suggest to implement a similar approach as vim: commands like "delete" and ranges that can be further divided into motions and text objects and possible more (it looks like "visual selection" can be used as "objects" too?).

This could also fix #217 by not remembering input/delete but "commands".

syntonym avatar May 03 '15 21:05 syntonym

needs advanced parsing and infrastructure. Probably too much at this stage, but the parser should be powerful enough to grant this level of power, at least if plugins want to take advantage of it.

I put it into backlog. unfeasible with current resources, but a vision for the future.

stefanoborini avatar May 03 '15 21:05 stefanoborini

Would you accept pull requests that go into that direction?

syntonym avatar May 03 '15 22:05 syntonym

Absolutely.

stefanoborini avatar May 04 '15 11:05 stefanoborini