Sublime Forum

How to select till end of line with Shift+End Keys

#1

Hi guys,

I’ll appreciate your advice concerning the next key bindings I have tried:

{ "keys": ["shift", "end"],"command": "expand_selection","args": {"to": "eol", "extend": true} }

and

{ "keys": ["shift", "end"], "command": "move", "args": {"by": "chars", "forward": true, "count": -1} }

On both I was trying to select all characters from cursor to the end of the line.
But it goes to the end of the file.

Along I’ll be happy to know how to select until the beginning of the line.

Working on macos 14.

Thx!

0 Likes

#2

eol = end of line
bol = being of line

Fwiw, they are all in default keybindings.

	{ "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} },
	{ "keys": ["end"], "command": "move_to", "args": {"to": "eol", "extend": false} },
	{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true} },
	{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
	{ "keys": ["ctrl+home"], "command": "move_to", "args": {"to": "bof", "extend": false} },
	{ "keys": ["ctrl+end"], "command": "move_to", "args": {"to": "eof", "extend": false} },
	{ "keys": ["ctrl+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true} },
	{ "keys": ["ctrl+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true} },

I remember there seems to be “hard bol” as well… “hbol”?

1 Like

#3

Thank you @jfcherng .
I forgot to mention that I work on macos 14 so it is not in the defaults. Sorry for that.

And I tried hbol and heol - didn’t help.

0 Likes

#4

On macOS those keybindings are provided by the operating system. It’s cmd+shift+right by default on macOS. You can change these keybindings globally, see https://apple.stackexchange.com/questions/16135/remap-home-and-end-to-beginning-and-end-of-line

0 Likes