In Sublime Text 2, how to make a key mapping to move the cursor up or down multiple lines

sublime-text-2

I'm trying the following key mapping, but it only moves the cursor up one line at a time. I'd like it to move 10 lines at a time. It seems the "amount" paramater is ignored.

{ "keys": ["alt+down"], "command": "move", "args": {"by": "lines", "forward": true, "amount": 10.0} },
{ "keys": ["alt+up"], "command": "move", "args": {"by": "lines", "forward": false, "amount": 10.0} }

Best Answer

  • You can create a plugin that gets called from a key binding, this plugin can then collect the current line and move it down or up.

    This post on the offical sublime forums has an example how to move back and forth 10 lines with a plugin.

  • Related Question