Improve quick find: need RegEx and Extend selection

Started by Stefan, January 20, 2009, 04:25:21 PM

Previous topic - Next topic

Stefan

Quote from: alex on January 07, 2009, 03:05:09 PM
2,3,4) I would combine this 3 requests in one.
How to select-to from current position till some text.
There are tow ways to achives this.
First. Use search dialog and option Extend Selection.
If you have better idea how to merge these 3 actions in one clever command - suggest ;)

>If you have better idea how to merge these 3 actions in one clever command - suggest ;)
Most i can do with search for regex and extend selection.
But i want to do this without open Find-Dialog.

The QuickFind-Bar comes in handy here.
But i miss and wanna suggest:

1.) RegEx function for the QuickFind
2.) Extend Selection feature

Even better:
Can the QuickFind be extended to allow to use an PERL and VIM RegEx syntax like %s/find/replace/modifier
where s/ switch to regex mode and s&r in this line for the first occurrence only
and an modifier g would search all occurrences within an line
and % would search in the whole file, not only in current line?
As modifier you could add your own signs, f.ex. 'x' to advice to extend selection?

It would be nice if user can design own modifiers, f.ex. to execute an editor command or call an script.
So i want f.ex. to find 'word' and copy all lines in an new doc by using %s/word/\&/exec(HE.edit.copy)

And it would be handy if we can use grep first and then s///m
and also the opposite of g, the v switch to work on line not match.
If g or v match i want to execute an second command like s///m or an editor command or call an script.

Of course we had to switch to an special mode in QuickFind first,
perhaps by using an prefix, or an checkbox or use an completely other dialog?

To advanced?
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Hi Stefan,

what you want is something as command line from vim or emacs ;)
Where you can do/call what ever you want.

And this is a little bit different from purpose of Quick Search bar, that was designed to nake search easier and more simple with minimalistic user interface. I do not want to create an another search dialog or move all possibilities from there to search bar. You extended synatax, requires also special check boxes for enabling this special mode, and extned selection and regex -> minimum 3 more checkboxes.
So, I would keep search bar like it is know. Even without adding regular expression option. If you need it, use search dialog which has also helper menues for regex etc...

But some kind of command bar, where you can enter commands from keyboard in verbal form with paramters etc is a good idea. Especially when you would think about macro recorder etc, where such functinality would be necessary also. And about this I can think and place into my todo ;)
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

JJK

QuoteBut some kind of command bar, where you can enter commands from keyboard in verbal form with paramters etc is a good idea. Especially when you would think about macro recorder etc, where such functinality would be necessary also. And about this I can think and place into my todo
I support that :)
Yes, a bit of scripting in fact... Long time ago, I used vi or so (under Unix in 70's !! in the ends of 70's yet) and it was very efficient, but often occult :(
I'll learn again... Life is an eternal new beginning...

Stefan

#3
Quote from: alex on January 22, 2009, 02:07:21 PM
So, I would keep search bar like it is know. Even without adding regular expression option.
If you need it, use search dialog which has also helper menues for regex etc...
I don't need the helper menus. But for such an small button there is still an place in the QuickFind bar.
And my indention was to not use the find dialog, like you, as you inducted the QuickFind bar.
Just have the document in view and type my search command in the line under the text.

QuoteYou extended synatax, requires also special check boxes for enabling
this special mode, and extned selection and regex -> minimum 3 more checkboxes.
There is enough place an this bar, even for an 'replace with:' -box.
Or how about an little drop-down menu, i just found this idea:
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Idea about the small menu under icon on left side as in FireFox or Opera search field I like :)
So in this way I think such additional options are also possible in QuickSearch bar - this would not make interface more complex
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

Stefan

#5
Oho, i got an better idea...
... i always think to put search-options into the search-field (like i suggest in my first post).


But this is better/easier to implement i think  >>> provide an third field for s&r options.

So before you put effort in this, maybe the following is from interest for you?



I think here about options like
X, use RegEx
'cs' to take care of case,
or '%' to find in whole doc,
or 'g' to search for all occurrences within an line.
wr, wrap search
wo, whole word only
i, incremental
?, ask to replace
es, extend selection


Because TAB and type the options would be quicker then open any menu or even check an check-box.

__[Menu_|v]  Find:[_teh_____ |v]..........Options:[ i,cs,wo,wr __ |v]..........Replace:[_the_____ |v]_


Ctrl+Q - searchText: teh - TAB - options: i,cs,wo,wr  - TAB - replaceText: the - Enter Done.

Often, f.ex,  i have to rename names of variables
and there would come such an easy accessible s&r in handy.
Ctrl+Q - searchText - TAB - options or not  - TAB - replaceText - Enter Done.

----

This options could be improved later by adding:
1, to start from line 1 (TOF)
1-3, execute on line 1 till 3 only
1s2, every second line only
script("test.vbs" , 1), run script or macro for each find or all finds


----

To make myself clear, here an pic of what i am dreaming about....

The options could be selected from an menu and also set by typing the related shortcut in the options-field:
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-