Home Download Buy Blog Forum Support

Hotkey to add a cursor

Hotkey to add a cursor

Postby cpsubrian on Tue Nov 15, 2011 7:04 pm

Hey all, loving sublime so far!

There is a hotkey I'm not finding.. which probably means it doesn't exist yet. What I'd like to do is have some mode where you are moving around a block of code with one cursor, and pressing a key to mark a spot for a multi-cursor edit. When you have all the cursors added you press another key to start multi-editing.

Basically it would work like CTRL-clicking with your mouse, but you do it via the keyboard.

For example... given the following block of php code:

Code: Select all
<?php
$myArray = array(
  'color'=> 'red',
  'size'=> 'medium',
  'age'=> 124,
);


Lets say my cursor is in front of the first "=>". I want to move through the code with the arrow keys and drop a multi-cursor in front of the other "=>'s. Then, I press some key combo to actually start multi-editing .. at which point maybe I'm just added a space in front of each '=>'.



Unrelated side question:
I know CTRL-F3 (windows) finds the next item matching your current selection... is there a way I can have that item added to the selection. Basically a version of ALT-F3 that selects matches one-at-a-time instead of just selecting all matches in the file?
cpsubrian
 
Posts: 1
Joined: Tue Nov 15, 2011 6:54 pm

Re: Hotkey to add a cursor

Postby bizoo on Tue Nov 15, 2011 7:32 pm

Select More (ctrl+d) ?
bizoo
 
Posts: 879
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Hotkey to add a cursor

Postby spadgos on Wed Nov 16, 2011 1:35 pm

That would actually be a nice feature. right now it seems your only real option is to use the mouse and ctrl+click
spadgos
 
Posts: 121
Joined: Thu Oct 06, 2011 12:49 am

Re: Hotkey to add a cursor

Postby gjd on Wed Nov 16, 2011 6:16 pm

cpsubrian wrote:There is a hotkey I'm not finding.. which probably means it doesn't exist yet. What I'd like to do is have some mode where you are moving around a block of code with one cursor, and pressing a key to mark a spot for a multi-cursor edit. When you have all the cursors added you press another key to start multi-editing.


Yeah, that sounds excellent. I'm not sure of a way to do that now.

Unrelated side question:
I know CTRL-F3 (windows) finds the next item matching your current selection... is there a way I can have that item added to the selection. Basically a version of ALT-F3 that selects matches one-at-a-time instead of just selecting all matches in the file?


Ctrl+d, it's awesome.
gjd
 
Posts: 8
Joined: Sat Oct 22, 2011 11:09 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 33 guests