Home Download Buy Blog Forum Support

Sublime as a replacement for my current editor

Re: Sublime as a replacement for my current editor

Postby PinnacleWebDesign on Sun Aug 09, 2009 7:40 pm

Sort of - It seems to work vertically if I do that, but if I use the right and left arrow keys, the cursor just jumps to the next word and nothing is selected.

Visual studio and intype let you select rectangular sections of code by holding down the alt key. With ultra edit you put it into 'column mode' by first using alt + c then select the blocks of text

Cheers,
Mick
PinnacleWebDesign
 
Posts: 33
Joined: Sun Aug 09, 2009 6:43 pm
Location: UK

Re: Sublime as a replacement for my current editor

Postby vim on Sun Aug 09, 2009 8:03 pm

well, it is a different concept here, because it is not a selection, but rather a multiplication of the cursor. imo, this far stronger, because you can edit all those places instantly, and of course mark the required characters as you like. for example, if you have a rectangular area you want to mark and replace/edit, it will look the same, but if the area is of certain structure, which is not with the same length on each line - here sublime start to shine, e.g. try and edit the following on the editors you have mentioned:

Code: Select all
L_acc = L_deposit_l( gbk1[index1][1] );
L_accb = L_deposit_l( gbk2[index2][1] );
L_gbk12 = L_add( L_acc, L_accb );       
tmp = extract_l( L_shr( L_gbk12,1 ) ); 
L_acc = L_mult(tmp, gcode0);


now, try and add _xyz on all functions calls... in sublime you just do the multiple cursor magic at the start of the line, going down 5 lines, now jump with ctrl+left arrow 3 times, insert _xyz - DONE!

Code: Select all
L_acc = L_deposit_l_xyz( gbk1[index1][1] );
L_accb = L_deposit_l_xyz( gbk2[index2][1] );
L_gbk12 = L_add_xyz( L_acc, L_accb );       
tmp = extract_l_xyz( L_shr( L_gbk12,1 ) );   
L_acc = L_mult_xyz(tmp, gcode0);
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: Sublime as a replacement for my current editor

Postby PinnacleWebDesign on Mon Aug 10, 2009 12:46 pm

Thanks very much for the reply, Vim.

The way this works in Sublime is way more powerful than the 'standard' column or region select. I can see that this will prove extremely useful and will save me loads of time.

Cheers,
Mick
PinnacleWebDesign
 
Posts: 33
Joined: Sun Aug 09, 2009 6:43 pm
Location: UK

Re: Sublime as a replacement for my current editor

Postby Kneehat on Tue Aug 11, 2009 9:21 pm

This works perfectly except for cut/copy/paste scenarios. For example, in the following trivial example, how would I column select the numbers at the end of test and stick them at the end of line, so :

Code: Select all
test1 line
test2 line
test3 line


becomes

Code: Select all
test line1
test line2
test line3


I guess this question really is, is there a way to column-paste?
Kneehat
 
Posts: 17
Joined: Tue Aug 11, 2009 8:16 pm

Re: Sublime as a replacement for my current editor

Postby vim on Wed Aug 12, 2009 2:05 pm

sublimator wrote:Not off the shelf. But the editor is extensible with python so writing a plugin that does that is a breeze. Check out GPSMURF's PasteColumn plugin here


true, for me, this is the mostly used plugin. i used it all the time with column related tasks.
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: Sublime as a replacement for my current editor

Postby EJ12N on Wed Aug 12, 2009 3:38 pm

sublimator wrote:There's also this automatic column selection command

It works fairly well albeit horribly inefficiently. It's a prototype I never `finished` but I use it all the time for column selection tasks. It's also available in EJ12Ns PowerUser pack.


yup that + pastecolumn is there too, it's just awesome :)
EJ12N
 
Posts: 281
Joined: Tue Apr 21, 2009 5:23 pm

Re: Sublime as a replacement for my current editor

Postby Kneehat on Wed Aug 12, 2009 6:29 pm

Aha perfect, I hadn't spotted those plugins. Thanks guys.
Kneehat
 
Posts: 17
Joined: Tue Aug 11, 2009 8:16 pm

Previous

Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot] and 20 guests