Sublime Forum

Moving the cursor up or down when there is a selection

#1

If I select some text and then press up or down, the cursor moves to the beginning or end of the selection instead of moving up or down one line, which is what I’m used to. Is there any way to change this behavior?

0 Likes

#2

+1

0 Likes

#3

I solved it by replicating the behaviour of hjkl in my User keymap

	// Avoid breaking visual mode
	{ "keys": "down"], "command": "set_motion", "args": {
		"motion": "move",
		"motion_args": {"by": "lines", "forward": true, "extend": true }},
		"context": {"key": "setting.command_mode"}]
	},

	{ "keys": "up"], "command": "set_motion", "args": {
		"motion": "move",
		"motion_args": {"by": "lines", "forward": false, "extend": true }},
		"context": {"key": "setting.command_mode"}]
	},

	{ "keys": "right"], "command": "set_motion", "args": {
		"motion": "vi_move_by_characters_in_line",
		"motion_args": {"forward": true, "extend": true, "visual": false }},
		"context": {"key": "setting.command_mode"}]
	},

	{ "keys": "left"], "command": "set_motion", "args": {
		"motion": "vi_move_by_characters_in_line",
		"motion_args": {"forward": false, "extend": true }},
		"context": {"key": "setting.command_mode"}]
	}
0 Likes

#4

btw, the current dev builds incorporate the requested behavior

0 Likes