Home Download Buy Blog Forum Support

Moving backwards and forwards by x lines

Moving backwards and forwards by x lines

Postby BenBradley on Thu Jan 16, 2014 10:19 am

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.
BenBradley
 
Posts: 2
Joined: Thu Jan 16, 2014 10:16 am

Re: Moving backwards and forwards by x lines

Postby BenBradley on Thu Jan 30, 2014 3:45 pm

bump.
BenBradley
 
Posts: 2
Joined: Thu Jan 16, 2014 10:16 am

Re: Moving backwards and forwards by x lines

Postby skuroda on Thu Jan 30, 2014 10:16 pm

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

Code: Select all
    { "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.
skuroda
 
Posts: 687
Joined: Fri Oct 05, 2012 8:11 am


Return to General Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 21 guests