On Saturday, August 11, 2012 at 9:32 AM, Hans Stimer wrote:
I'm looking for advice on the best way to hack minimal VIM support into TM2. I'm not looking to support all of VIM, but just a subset of what is known as Command Mode.Desired behavior---Until Vim Command Mode is activated, TM2 should behave as normal. Once activated, all the <meta>*-<key> combinations will continue to work as normal TM2 commands, but non-meta key combinations will be interpreted as VIM commands.Entering Vim Command Mode---Traditionally, Vim command mode is entered via hitting the escape key. Since most people won't want this feature, there needs to be a toggle that enables the Vim behavior so that the escape key would work. This prevents existing TM2 escape behavior changing for those who don't want the optional Vim behavior.Additionally, it is not uncommon for VIM users to remap the Vim Command Mode entry trigger to something like "jj". This should be supported so that users can optionally have escape key can retain it's traditional TM2 use.Vim Command Mode---I envision a basic set of Vim motion and selection commands:Character movement:k or up arrow - upj or down arrow - downh or left arrow - leftl or right arrow - rightWord movement:e - to end of word as defined by current syntax (this is different from standard VIM behavior and should be reconsidered)E - to end of a whitespace-delimited wordb - to beginning of word as defined by current syntax (this is different from standard VIM behavior and should be reconsidered)