David Fishburn wrote:
> > > This is very useful for me, but I suspect other plugin developers will > > > also benefit since they can make smarter functions by looking at what > > > the user has keyed in. > > > > Well, I can see that you get the information, but this is not really a > > useful real-world example. Think of a user that wants to get something > > done for which v:operator is needed. And for which there is no other > > solution. > > > This is as real as it gets, using omaps there is no other solution > that I or this list could find. > > The echo was just an FYI to the user, but my function is replaying the > command the user typed so that I can later act on the effects of the > command: > exec "normal! ". > \ ((v:count > 0)?(v:count):''). > \ (v:register=='"'?'':'"'.v:register). > \ v:operator. > \ cmd > > Without v:operator, anyone who is writing an omap is hamstrung. omap > lets me define (or redefine) a motion. But without the context of the > command (in this case I don't know whether the user is yanking, > deleting or changing). Vim provides all the other information except > this one piece of critical data (basically the same thing showcmd > displays in the statusline). omaps can be much more useful than they > currently are. > > In my "real" world plugin I will be creating an omap for every motion > Vim supports. That way I have the opporunity to record changes made > by Vim and the user. The YankRing is missing a lot of functionality > at the moment since I cannot support change commands (and quite a few > others) but omaps can provide the missing link, but they are > essentially useless without providing the "intent" of the user. > "c,d,y" provides that context. Well, if you show us the omap for one command that would be the example I was asking for. Leaving out some of the YankRing stuff perhaps to keep it small. -- hundred-and-one symptoms of being an internet addict: 69. Yahoo welcomes you with your own start page /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
