ohhh! i didn't know that one.
searched the forum, read jon's email, i will have to play some with this...
<binding key="d" command="deleteRange ${motion}"><context name="option" value="commandMode"/></binding>
<namespace name="motion">
<binding key="w" command="words 1"/>
<binding key="b" command="words -1"/>
<binding key="j" command="lines 1"/>
<binding key="k" command="lines -1"/>
<binding key="enter" command="lines 1"/>
<binding key="shift+enter" command="lines -1"/>
<binding key="h" command="characters -1"/>
<binding key="l" command="characters 1"/>
<binding key=" " command="characters 1"/>
<binding key="shift+space" command="characters -1"/>
<binding key="$" command="eol"/>
<binding key="^" command="bol"/>
<binding key="G" command="eof"/>
</namespace>
class InsertModeCommand(sublimeplugin.TextCommand):
def run(self, view, args):
print "entering insert mode"
view.options().set('commandMode', False)
view.runCommand('markUndoGroupsForGluing')
if len(args) > 0:
if args[0] == 'bol':
view.runCommand('moveTo bol')
elif args[0] == 'eol':
view.runCommand('moveTo eol')
elif args[0] == 'append':
view.runCommand('move characters 0')
class CommandModeCommand(sublimeplugin.TextCommand):
def run(self, view, args):
print "entering command mode"
view.options().set('commandMode', True)
view.runCommand('glueMarkedUndoGroups')
<binding key="i" command="insertMode"><context name="option" value="commandMode"/></binding>
<binding key="I" command="insertMode bol"><context name="option" value="commandMode"/></binding>
<binding key="a" command="insertMode append"><context name="option" value="commandMode"/></binding>
<binding key="A" command="insertMode eol"><context name="option" value="commandMode"/></binding>
<binding key="ctrl+h" command="open"/>
<binding key="ctrl+h,2" command="openIn"/>
<binding key="ctrl+h,2,a" command="openInSomething"/>
<binding key="ctrl+h,p" command="openProj"/>
<binding key="ctrl+h,p,p" command="openProj quickpanel"/>vim wrote:this is actually one of the differences from Vi. on Vi, when having two key bindings that over lap, e.g. d - action1 and dd - action2, after you press d once, Vi will wait for a short period of time (half a sec +/-) and if no more inputs it will decide you wanted action1 (d). Sublime Text it will wait till it sure what is the key sequence you entered, so when you enter d once it will wait till your next key press, to see if it's another d (->action2) or another key (->action1 and use the other input as normal key stroke).
this have always seems odd to me, because due to this behavior i can't bind frequent commands to shorter sequences. i would prefer to be able to group similar commands, like that:
- Code: Select all
<binding key="ctrl+h" command="open"/>
<binding key="ctrl+h,2" command="openIn"/>
<binding key="ctrl+h,2,a" command="openInSomething"/>
<binding key="ctrl+h,p" command="openProj"/>
<binding key="ctrl+h,p,p" command="openProj quickpanel"/>
Return to Ideas and Feature Requests
Users browsing this forum: le N?KO and 5 guests