Home Download Buy Blog Forum Support

Free Select Mode

Re: Free Select Mode

Postby adzenith on Thu Dec 09, 2010 11:08 pm

Sublimator's multiselect plugin (I've never used it) actually seems to do something similar:
http://bitbucket.org/sublimator/multiselect/wiki/Home
From the docs:
AUTOSELECT
In this mode, whenever you select anything it will "store" that selection and make it "sticky" so it stays selected.
You can move around in the document, edit it, and do whatever, just remember any selection you do it will get "sticky".
If you select a "sticky" selection again it will a deselect that selection and it will no longer be "stored" or "sticky"

You could use this in a hackish sort of way to create multiple insertion points: select the character to the right of each insertion point you want, and then when you've got 'em all leave this mode, press the left arrow key, and you're good to go. You could also edit the plugin or map these actions do different keystrokes (i.e. ctrl+i: "move characters 1 extend" to add an insertion point, then some key that leaves autoselect mode and also does "move characters -1").
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Free Select Mode

Postby willi297 on Fri Dec 10, 2010 4:12 pm

adzenith,

Yeah, thanks. I guess I'm blind, cuz yeah, Find All does exactly what I'm wanting. I think I will map the same shortcut as well. ;)
Greg Williams
Atomic Embedded, USA
http://atomicembedded.com
willi297
 
Posts: 121
Joined: Wed Nov 18, 2009 8:29 pm
Location: Grand Rapids, MI, USA

Re: Free Select Mode

Postby bizoo on Fri Dec 10, 2010 8:41 pm

sublimator wrote:Multiselect was written before we had onSelectionModified event handler. I might actually rewrite it tomorrow cause right now it uses modal bindings to hijack the arrow keys to determine when you change selection. I'd rather make it global and it need some other quirks fixed to make it more friendly to use.

I use it fairly often actually and along with hotspots, I almost never reach for the mouse except for the occasional minimap or scrolling.

Alt f3 is pretty cool. Especially if you auto scope it to the local function.
Image


Woah ! How do You select the entire function 'run' ???
What do You mean by 'Especially if you auto scope it to the local function' ???
Ctrl-Shift-Space doesn't work for me, do You have a custom Python Grammar ?
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Free Select Mode

Postby willi297 on Sun Dec 12, 2010 2:44 pm

Would be nice if X would have a built-in scope growing and shrinkage.

subliminator, I haven't checked out this hackish magic, but the scoping is something I've been longing for since I really started developing some multi-select mojo.

I would think it would be nice to do scoping in the following manner:
cursor<->word<->paragraph<->function(if applicable)<->class(if applicable)<->buffer

or I guess a more flexible would just be incremental block scoping:
cursor<->word<->statement(maybe?)<->blockA(containing cursor)<->blockB(containing A)<-....->buffer
Greg Williams
Atomic Embedded, USA
http://atomicembedded.com
willi297
 
Posts: 121
Joined: Wed Nov 18, 2009 8:29 pm
Location: Grand Rapids, MI, USA

Re: Free Select Mode

Postby adzenith on Mon Dec 13, 2010 12:39 am

The following default keybinding is pretty sweet:
<binding key="ctrl+shift+space" command="expandSelectionTo scope"/>
It does this:
blockA(containing cursor)->blockB(containing A)->etc.
It doesn't do the word thing by itself, but you can select a word with ctrl+d.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Free Select Mode

Postby bizoo on Mon Dec 13, 2010 12:15 pm

Thanks sublimator for your answer.

Is it possible to define a scope that include all the content of a procedure/class in the grammar ?
I didn't find any example in the standard packages of ST and even with the nice tutorial of guillermooo (http://www.sublimetext.info/docs/extensibility/syntaxdefs.html), it doesn'l look easy.

Define a multi-line scope without begin/end tag look like a complex task.
bizoo
 
Posts: 886
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Previous

Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 7 guests