Author Topic: better vertical selection  (Read 3443 times)

Offline sans

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
better vertical selection
« on: September 01, 2011, 10:20:55 pm »
Hey,

i do a lot of copy pasting and vertical select is quite useful however, it only applies to which the mouse or the keyboard has selected. if only i can jump using the 'home' key or the 'end' key to go to the beginning or to the end off the line it would be much better. very useful to edit <li> items in html which do not have the same character count.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: better vertical selection
« Reply #1 on: September 01, 2011, 11:14:42 pm »
Hi sans,

welcome on forum!

Or I have not understood you, or this is already working...

Try to select something using keyboard Shift+Alt+Left/Right. Then you can also use Shift+Ctrl+Alt+Left/Right to block select to start/end of word. Or Shift+Alt+End to select till end of line etc.
Search for all *Column* commands in keyboard settings to get full overview.

BR, Alex.

Offline sans

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: better vertical selection
« Reply #2 on: September 03, 2011, 12:04:08 am »
Shift+Alt+End assumes your lines have the same length, what i was referring to was if i have li items with varying character lengths. ex:

<ul>
line item 1
another line item 1
short line item
very short line item
line item 2
line 3
</ul>

from the lines above, if i wish to insert a the tag <li> then </li>. on each of the lines, it will not be possible to append </li> as Shift+Alt+End only jumps to 'line 3' eol. if its somewhat possible, could you please point it out to me? another is if you want to mass add ';', i can enumerate more but i guess you already get my point.

also, would it be better to just use the home and end key? that is of course, if vertical select is initiated first.
also, also, using SHIFT would mean i am selecting and not jumping so if i insert a code it will overwrite the selected codes.

just found the workaround, after adding in <li>, you will have to reselect the end of line items, my only problem is it does not detect the eol. it leaves a big space in between the line and </li>
<li>line item 1         </li>
<li>another line item 1 </li>
<li>short line item     </li>
<li>very short line item</li>
<li>line item 2         </li>
<li>line 3              </li>

« Last Edit: September 03, 2011, 12:27:36 am by sans »

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Re: better vertical selection
« Reply #3 on: September 03, 2011, 02:39:11 am »
Hi sans, welcome to the community!

That's an perfect example for an tool i wish to be implemented at default for a long time  :P

But HippoEDIT has already that feature build in, you just have to "activate" it.

We can do that by an "Code Templates" and %BEFORE%%SelectedLine%%AFTER% as template.
Please see that post for an how-to => nsert-in-front-or-at-end-of-line



You can also use an regex search&replace:
Code: [Select]
Replace all "^(.+)$" to "<i>$1</i>", "Selection", Use regular expression,

- - -
BTW

That the zero-width column mode
insert on all lines at the same, namely the widest position
instead of the EOL after the last sign on each line
can be seen as a feature.

But do it alternatively the way you had first imagine is also an nice to have feature.
I don't know if this is currently possible. Or, if not, how this can be implemented as an alternative, switchable mode.
But i can see an use of this and it is worth to think about.

But as always: "easy to wrote, but hard to code". Lets hear what Alex thinks about.
« Last Edit: September 03, 2011, 02:41:06 am by Stefan »

Offline sans

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: better vertical selection
« Reply #4 on: September 03, 2011, 04:32:39 am »
hey stefan,

the macro will work just fine but of course it would be more nice if it was implemented the way i imagined it. for now, your method is superr, thanks


--
hey, i search the web and tried out sublime text and they have an impressive implementation, i wish HE could mimic this somehow.
http://www.screencast.com/t/QTXpasbBW
« Last Edit: September 03, 2011, 04:45:57 am by sans »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: better vertical selection
« Reply #5 on: September 04, 2011, 09:49:42 pm »
Hi sans,

what you want, and has shown in Sublime editor, it is actually have nothing to do with vertical (or column mode) selection. This is another feature called multi-selection (was already discussed in HippoEDIT vs Sublime editor topic, but your example is more explanatory). The feature is good, nice and I like it; and time for it will come :) It is planned, but not for 1.50.

Changing of existing block selection functionality in incompatible way or reprogram shortcuts not intuitively, I think is bad idea. For example, maybe not all will like, that End key will take max line length bu not current.

In addition to way suggested you by Stefan, I can add that with 1.50 you will be able to do more smarted surrounding with scripting.

Best regards,
Alex.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
zero-width Vertical selection at end of line instead straight vertical line
« Reply #6 on: February 05, 2012, 08:30:16 pm »
I just wonder how to do that, as i need it currently too.

My problem:
Right now, an zero-width selection is just an straight vertical line.
Even at the right end of lines from several different length.

For example the code from above:

<li>line item 1             |
<li>another line item 1 |
<li>short line item        |
<li>very short line item|



But that can be done by an non-zero-width selection too.

Question:
Is it possible to have an (easy accessible) option to switch the zw-selection behaviour,
to behave, if this sw-sel is done on the right side of EOL, to go left right behind the last sign ?

<li>line item 1|
<li>another line item 1|
<li>short line item|
<li>very short line item|

Example vid:
http://youtu.be/AvaUVDxKkTA


This should be work easy, but i can also imagine an new option "find EOL and put selection right after" as second step.
But i find an switch option " vertical line/at EOL" more useful.


Or do i miss something?
I know regex s&r, scripting and code templates, but this feature is too important too make it complicated for average users.
« Last Edit: February 06, 2012, 12:29:33 am by Stefan »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: better vertical selection
« Reply #7 on: February 06, 2012, 04:13:59 am »
Hi Stefan,

I think something like this already exist in emeditor (I have seen similar video), and probably in Sublime text editor.
I agree it is useful, and I think it will come, but not now. The prerequisite to this feature should be multiple selection, which is not available in HE right now.
As far as it will be ready, we can discuss the request once more - to find a right way to implement it (I mean from user point of view).

BR, Alex.

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
1847 Views
Last post February 18, 2009, 11:27:17 pm
by alex
1 Replies
2494 Views
Last post April 28, 2009, 10:38:50 pm
by alex
3 Replies
2199 Views
Last post April 22, 2010, 10:30:54 pm
by Theno
2 Replies
1815 Views
Last post August 11, 2010, 03:46:24 pm
by alex
4 Replies
1837 Views
Last post January 12, 2015, 06:30:39 pm
by alex