Author Topic: block selection usage questions  (Read 8102 times)

slick

  • Community Member
  • Posts: 10
  • Hero Points: 0
block selection usage questions
« on: August 03, 2007, 10:44:59 pm »
I've used Codewright in the past and I'm trying to get SE to work the same way for the following features.  Hope it can be done.

- Is there a way to block select a few colums/rows, hit delete and delete the selected area?  Currently for me delete is deleting the last character of the last line of selected block.
- If I select a few lines and hit delete, it deletes the first character of the last line selected.  I'd like to delete the entire selection.
- Is it possible to specify characters to "shift selection right...".  That is if I'd like to insert "//" in front of each line in a selected block, can I specify that somehow with shift selection right or any equivalent command?  Trying to get the equivalent of Codewright's "prompted slide in"/slide out commands.

Thanks!

hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 285
Re: block selection usage questions
« Reply #1 on: August 03, 2007, 11:18:43 pm »
1.) What's the keybinding of your delete key ? Sounds like it's bound to 'delete-char'.
Check 'Tools>Options>Redefine Common Keys' for an approriate binding.
2.) ditto
3.) You could use v12.02 and the new comment / uncommnet line/block feature ;) BTW: What version do you use ?
Or you can use the 'slide-in-prompt' resp. 'slide-out-prompt' commands on commandline or via keybinding.
Additionally there is a 'block-insert-text' command.
For all of these command a block/line selection is required.

Good luck,
HS2

slick

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: block selection usage questions
« Reply #2 on: August 04, 2007, 12:16:51 am »
Thanks a lot for the response HS2.

You were right.  Delete key was bound to 'delete-char'.  I'm using the vim emulation mode and I found that I was unable to get the block delete behavior when I bound the delete key to 'Linewrap delete char'.  So, I tried switching to the CUA emulation to see if it would work as I want and it did.  I then looked at all the options that were checked under '>tools>options>redefine common keys'.  I switched back to the vim emulation mode and redefined the delete key with the same options as in the CUA mode.  But it still behaved as I previously noted :-(.  I then tried binding a key to 'vi-visual-delete' and that seems to be working...

I'm using version 11.0.1.

I can't seem to find the slide-in-prompt, slide-out-prompt commands on the command line.  Are they not supported in v11.0.1?

hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 285
Re: block selection usage questions
« Reply #3 on: August 04, 2007, 12:42:52 am »
Sorry - this was a user submitted macro long time ago. I'm using this stuff all these years so I thought it's part of the product ...
See attached the original macro module incl. a readme.
Unzip and maybe put aligneq.e into your <SE-install dir>/macros dir and do a 'Macro>Load Module: aligneq.e'.
After doing so you can use it.

HS2

Edit: Normally you can simply start typing when you've selected a block. The text is inserted (selected text might be replaced). But I'm not sure if this is valid for all emulations and if this was already there in v11.0.x.
« Last Edit: August 04, 2007, 01:47:34 am by hs2 »

slick

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: block selection usage questions
« Reply #4 on: August 04, 2007, 01:20:48 am »
It works like a charm!  Thanks a lot HS2.

shameed

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: block selection usage questions
« Reply #5 on: September 05, 2007, 05:45:46 pm »

I have just moved over to SlickEdit from Codewright, and I am overall happy with it.  But I am really surprised that for something as basic as "Prompted Slide-in" does not exist in SlickEdit.  Anyway apparently there is some macro references in this thread but unfortunately I don't see the attachment mentioned by hs2 in this thread.

Could anyone post the attachment for this macro?  I am using SlickEdit 11.0.0.

Thanks.

hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 285
Re: block selection usage questions
« Reply #6 on: September 05, 2007, 06:08:47 pm »
As mentioned you can always block select a number of lines (single column) and start typing. The text is inserted in every covered line. This is quite similar to 'Prompted Slide-in'.
However, the macro modules is contained in the attached 'slide-io_align.zip' file in this post:
http://community.slickedit.com/index.php?topic=1930.msg8135#msg8135
If you don't see this attachment I guess there is sth. wrong with you browser.
Have fun, HS2

shameed

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: block selection usage questions
« Reply #7 on: September 05, 2007, 06:27:10 pm »

Hello hs2:

Thanks for the reply.  If I select a block of lines and then start typing it deletes those lines and start typing the new text.  I am using version 11.0.0.  This may be a feature in the later versions.

I still don't see the attachment.  I used Firefox and IE.  I see that that post has been edited.  But I don't see the attachment link.  Where is it? Left, right, top, bottom??

Your help is appreciated.

thanks.

shameed

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: block selection usage questions
« Reply #8 on: September 05, 2007, 06:29:50 pm »

Ok, never mind I see it now for some reason.  I swear it was not showing before.

Anyway I will try it out.  Thanks for your help.


hs2

  • Senior Community Member
  • Posts: 2736
  • Hero Points: 285
Re: block selection usage questions
« Reply #9 on: September 05, 2007, 06:55:05 pm »
I mean block aka. column selections - see 'Edit>Select>Block'.
In Brief emulation I can start such a selection type by 'ALT-C' e.g. in column 1 and then move the cursor down some lines. After that I can start typing and the text is inserted.
You should check the help concerning this topic. AFAIK this was always available in SE and for sure in v11.
Good luck, HS2

Edit: These commands are also available e.g. on SE commandline after creating a block selection: 'block-insert-mode' and 'block-insert-text' (hit <ESC>, enter a command and execute it by pressing <ENTER>).
The latter is just providing a dialog where the text to insert can be entered.
« Last Edit: September 05, 2007, 07:05:19 pm by hs2 »