Alex Rivera | Logout

Sublime text 2, ctrl+d not working as expected

Asked 2013-06-04T08:38:17.880
9

It seems that 'quick add next' and 'expand selection to word' are both mapped to the same key binding.

I am not sure how to override/change the 'expand selection to word' because I cannot find the current key binding for both actions.

Does anyone know what the two actions are called?

Just to clarify, let's say I have the following block of code

this.GRID_TOP = 10;
this.GRID_SPACING = 10;
this.GRID_HEIGHT = 10;
this.GRID_WIDTH = 10;

I want to select the 'GRID' string on each line. I could use alt+F3 but that's overkill. I want to select 'GRID' then hit ctrl+D to select the subsequent matches. My problem is that it works once (selects first two) but then expands both cursors to the end of their words. Since the selections are now different, I cannot 'quick add next'.

Edit
Report

1 Answer

5

Go to Preferences > Key Bindings - User

put following lines and save the file:

{ "keys": ["ctrl+d"], "command": "find_under_expand" },
{ "keys": ["ctrl+k"], "command": "find_under_expand_skip" },
{ "keys": ["ctrl+alt+d"], "command": "dpaste"}

It works for me. I've got installed DPaste package. That is why I had to overwrite its shortcut with the last line. Dpaste comes by default with ctrl+d

Hope it help

answered 2013-06-24T01:10:03.210

Your Answer