Sublime Forum

Move by paragraph

#1

There was a “MoveByParagraph” package for ST2, but it doesn’t work in ST4 or it’s not suitable for my purposes. I am attempting to customize my key bindings to move the insertion point to the end (or the beginning) of the current paragraph. Currently, I have these entries:

{ “keys”: [“ctrl+up”], “command”: “move_to”, “args”: { “to”: “hardbol”} },
{ “keys”: [“ctrl+down”], “command”: “move_to”, “args”: { “to”: “hardeol”} },

They work but I would like to be able to press my keys again and so go further to the next hardeol or hardbol. Now, I have to manually move the cursor to the following or the previous paragraph to be able to go to the next hardeol (or hardbol). Any suggestions? Thanking you in advance.

0 Likes

#2

Not sure if it is exactly what you want, but you may try the following one.

0 Likes

#3

Thank you very much for your message, but I am using Sublime Text as a general text editor and there is no empty line between my paragraphs…

0 Likes

#4

You just may need to replace the first lines of the macros with yours above then. The point is, you want to move to the line above hardbol or the line below hardeol. Instead of moving by lines you could try by "characters" instead.

0 Likes

#5

Thank you very much again. I’ll try and I’ll report.

0 Likes

#6

Thank you again. At last! This works for me:
Next paragraph
[
{ “command”: “move_to”, “args”: {“to”: “hardeol”, “forward”: true} },
{ “command”: “move”, “args”: {“by”: “lines”, “forward”: true} },
{ “command”: “move_to”, “args”: {“to”: “bol”, “extend”: false} }
]
Previous paragraph
[
{ “command”: “move_to”, “args”: {“to”: “hardbol”, “forward”: false} },
{ “command”: “move”, “args”: {“by”: “lines”, “forward”: false} },
{ “command”: “move_to”, “args”: {“to”: “bol”, “extend”: false} }
]

0 Likes