[TxMt] Re: Hacking Vim mode into TM2

Hans Stimer hans.stimer at gmail.com
Sun Aug 12 00:03:58 UTC 2012


Thanks Alan, I'll start by sticking it into keyDown, and we can change it later so that the code can be moved to a plugin.

--  
Hans Stimer
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Saturday, August 11, 2012 at 11:29 AM, Allan Odgaard wrote:

> On Aug 11, 2012, at 7:16 PM, Hans Stimer <hans.stimer at gmail.com (mailto:hans.stimer at gmail.com)> wrote:
>  
> > 1) Hard code it right into TM2. It looks like I could start with OakTextView:keydown and branch off to a Vim interpreter if Vim is enabled. I think this is probably the easiest and most flexible approach.  
>  
> This is how I’d approach it.
>  
> The keyDown is already multiplexing between normal mode, and snippet pop-up menu mode. It might be good to refactor that a bit so we can register event handlers at run-time, that would allow moving the vim code to a plug-in.
>  
> But without knowing exactly what you’d need from TM, easier to just start with hardcoding things in keyDown.
>  
> > 2) Create a TM2 plugin/bundle that does most of the work, and modify TM2 just enough to provide the support that such a plugin/bundle would need. This approach worries, me because I'm not sure how much modification TM2 would need to expose all the required interface to the plugin system. Do TM2 plugins work the same as TM1 plugins? Is the TM2 plugin API in flux?
>  
> They work the same, and there really isn’t any plug-in API other than the public Cocoa protocols that some of the classes implement, e.g. OakTextView conforms to NSResponder (which I assume have most of the methods you’d need to call from your vim mode).
>  
> P.S. I think it’s better to move discussions about the TM source to textmate-dev at lists.macromates.com (mailto:textmate-dev at lists.macromates.com)
>  
>  
>  
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com (mailto:textmate at lists.macromates.com)
> http://lists.macromates.com/listinfo/textmate
>  
>  


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20120811/032a2304/attachment-0001.html>


More information about the textmate mailing list