Home Download Buy Blog Forum Support

Moving the cursor up or down when there is a selection.

Moving the cursor up or down when there is a selection.

Postby FogleBird on Tue Aug 23, 2011 7:26 pm

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?
FogleBird
 
Posts: 4
Joined: Tue Aug 23, 2011 7:23 pm

Re: Moving the cursor up or down when there is a selection.

Postby qwerty1 on Fri Aug 26, 2011 3:57 am

+1
qwerty1
 
Posts: 11
Joined: Fri Jun 04, 2010 12:50 am

Re: Moving the cursor up or down when there is a selection.

Postby siavash on Mon Aug 29, 2011 11:18 am

I solved it by replicating the behaviour of hjkl in my User keymap
Code: Select all
   // 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"}]
   }
siavash
 
Posts: 1
Joined: Mon Aug 29, 2011 11:16 am

Re: Moving the cursor up or down when there is a selection.

Postby jps on Mon Aug 29, 2011 11:26 am

btw, the current dev builds incorporate the requested behavior
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 30 guests