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?
Moving the cursor up or down when there is a selection
siavash
#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