Sublime Forum

Moving backwards and forwards by x lines

#1

I am having difficulties setting up a keybinding to move backwards and forwards by x amount of lines. This is what I currently have:

{ "keys": "ctrl+super+p"], "command": "move", "args": { "by": "lines", "amount": 10, "forward": false} },
{ "keys": "ctrl+super+n"], "command": "move", "args": { "by": "lines", "amount": 10, "forward": true} },

This is only moving by one line up and down, what do I need to change. Thanks in advance for any help.

0 Likes

#2

bump.

0 Likes

#3

You can create a macro to do it, then bind your command to the macro, rather than the “move” command. The command you will bind to will be something like

    { "keys": "ctrl+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line.sublime-macro"} },

Of course replacing the file with the file for your macro. To save your macro to a file, simply go to “Tools -> Record Macro”, hit the direction 10 times, stop recording and save the file. I’d recommend saving it in your Packages/User directory. Ensure the file has a *.sublime-macro extension.

0 Likes