Sublime Forum

Move command

#1

The documentation for the move command says that the cursor can be moved for a number of lines, pages or stops (what ever those are). I currently have a key binding to the ctrl+down and ctrl+up keys to advance or back up 15 lines using the scroll command

{ “keys”: “ctrl+up”], “command”: “scroll_lines”, “args”: {“amount”: 15} },
{ “keys”: “ctrl+down”], “command”: “scroll_lines”, “args”: {“amount”: -15.0} },

I’d rather move the cursor up or down 15 lines with the same key binding, but I haven’t been able to use the “move by lines” with any success. Does anyone have and example on how to correctly use the “move by” command with lines or pages. It works with the ctrl+right/left and moving the cursor by wordboundaries, but I can not get the move by lines to work. Thanks for any suggestions.

0 Likes

#2

According to sublime-text-unofficial-document … s.html#id1 there is no parameter to define the amount of XXX (i.e. lines) being moved. You could write a small plugin for that but imo it should be supported natively.

0 Likes

Command to move by several lines
#3

You can do this using macro. Record macro and save it. Then create custom key binding like this

{ "keys": ["pageup"], "command": "run_macro_file", "args": {"file": "Packages/User/go_up_20_lines.sublime-macro"} },

You need to record another macro for revers action.

0 Likes