Kate can do Searching! 2007-08-26

Two weeks have passed since I last showed pictures of a possible future of the searching experience with KatePart, and thus Kate, KWrite and friends.

Since then progress has been made: Florian Grässle of OpenUsability strongly improved my original dialog drafts and I started implementing the improved dialog mockups. What you can see below are actual screenshots of Kate from the Subversion trunk.

Incremental search bar:

Power search and replace bar:
There is still more code to write and bugs to fix but the basic functionality is there. That plus previously missing features like support for

  • multi-line search patterns
  • escape sequence resolution in the replacement text.

That’s it for now, please don’t beat me if I should miss a bug :-)

Creative Commons License
The Kate can do Searching! by Sebastian Pipping, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

14 Comments
Thomas August 26th, 2007

I like this VERY much. Now Konqueror and Konsole (which I think is getting it for kde4…) need it!

Bill August 26th, 2007

The red X should be lower down so that it’s centered with the other widgets. Also, you got the expand and contract buttons on the right backward in the two screenshots.

Guy August 26th, 2007

I’d like the “highlight all” checkbox for the default dialogue, as that’s something that eases searching often significantly with just a single click.

Also: Where’s the RegEx search/replace in the power search version of the dialogue??? That’s essential to be able to compete with “grown up” editors as emacs!

Manabu August 26th, 2007

Here is another type of Search & Replace “dialog” that I like: http://img293.imageshack.us/my.php?image=editpadlitesearchreplacsy1.png

It is much more compact than this image that you showed, and can be resized freely holding the line where the close and minimize buttons are. The lower limit is when both Search and Replace are with one line, and uper one is when the main text box is with 5 lines. So it can be more adequate to multi-line search and replace, or compact to one line search an replace.

It apears at the botton of the screen, and as the defaut size is the one in the screenshot, it is easily found by the user. Latter he can minimize it with an double click or clicking in the correspondent button to only few pixels.

The downside is that is not easy to make an basic search only “dialog” much similar to it (as you made with your model).

Apart from that, with out changing much your current idea, I find the “Find First” and “[Find] Next” aproach more pratical than an checkbox “From Cursor”. And should the “Selection only” be enabled if there is no selection? Well, For me it don’t realy matter.

Oh, don’t forget to put in the yellow boxes that apear when you hover the mouse over an button (I forget the name for this) the keyboard shortcut for the respective functions.

Daniel Beck August 26th, 2007

I like this search and replace dialog. its really good, and looks intuitive to use.

Someone in the commentaries above said that he would like the “highlight all” checkbox for the default dialogue.

I think that the “highlight all” button isn’t needed at all: this mode should simply always be “on”. When someone writes a regular expression, the matching text should automatically be highlight, even without hitting enter or clicking some button.

In that way, a person who wants to replace text automatically gets feedback: which text is going to be deleted once I click “replace?”

Daniel Beck August 26th, 2007

I just had an other suggestion: sometimes when I use Firefox, I enter CTRL+F and I wonder myself why no dialog appears. The problem is that a dialog appeared, however in the bottom of the screen where I did not look at.

In my opinion, it would be very good to create some animation which makes clear that a search widgets opened on the bottom of the screen. Something like a genie-animation (osX).

Daniel Beck August 26th, 2007

I have an other suggestion too: sometimes when I use Firefox, I enter CTRL+F and I wonder myself why no dialog appears. The problem is that a dialog appeared, however in the bottom of the screen where I did not look at.

In my opinion, a well-thought animation would make it clearer that a search-widgets opened on the bottom of the screen. Something like a genie-animation (osX).

P.S. submitting comments do not seem to work well.

Stefan Monov August 26th, 2007

Multiline matching?
Say that again?
MULTILINE MATCHING?
This is beyond awesome.

sping August 27th, 2007

Please excuse my very brief machine-like reply:
* I’m happy to team up with people of Konqueror/Konsole if they like to
* The red X comes from a layer above the search dialog. I will have to check if moving it down breaks anything.
* Regex searching can be selected in the mode combobox. I agree that regex support is essential. :-)
* I agree “Selection only” should be disabled when no text is selected. That will probably come later since it requires code at other places to be modified.
* Tooltips (the yellow boxes) are on the way: I justed checked some in.
* People seem to disagree on the need of highlight all so there is an option for that to satisfy both parties. Sorry to say but highlight all is not implemented yet though.
* Potentially missing the dialog is a problem. I’m not sure though if there is any solution not introducing even bigger problems like waste of time for an animation or an informative but bugging dialog.
* Yes, multi-line matching. :-) That’s what I started all this for – I’m scratching my own itch here.

Fred P. August 27th, 2007

Please let me know when you will have multi-line, search and replace regexp in all documents working.

I’m still using editplus on wine
just for that feature!

What I really like is that I can select some text press CTRL+C, then CTRL+H (replace), press more, CTRL+V (paste), add reg-exp where I want, [x] regexp and do replace in all open document!

This feature is so nastily useful you can even start to even imagine how useful it is, trying to do the same in vim or any other editor would just be insane.

For instance, you can write a very powerful code generator in 15 seconds using this trick.
I can tell you I can amaze any nasty power vim
user with that! :D

Another nice feature, is to have “custom tools calls”

That and the fact that I can press CTRL+1, CTRL+2, …, CTRL+0 to run the current “script” directly under editplus, to compile it, run it,
test it, check it.

Basically, map:
ctrl+1 => perl
ctrl+2 => perl -c
ctrl+3 => bash
ctrl+4 => gcc
ctrl+5 => run the generated ($file).x
ctrl+6 => make a lib
ctrl+7 => javac ($file).java
ctrl+8 => java ($file)
ctrl+9 => php
ctrl+0 => mysql

You can also “switch tool group, by pressing”
ctrl+shift+0, 1,2,3,4,5,6,7,8,9

which gives you 10 groups tools x 10 custom tool
or 100 configurable user tools at your finger tips.

Here’s a test 30sec test scenario…
run a shell command with (capture output) using ctrl+3
copy paste, replace regexp, put in a qw{} or

Fred P. August 27th, 2007

Here’s a test 30sec test scenario… [continued]
run a shell command with (capture output) using ctrl+3
copy paste, replace regexp, put in a qw{} or

Fred P. August 27th, 2007

Here’s a test 30sec test scenario… [continued?]
run a shell command with (capture output) using ctrl+3
copy paste, replace regexp, put in a qw{} or EOF
add some quick perl, ctrl+1, add print qx(…), ctrl+1, capture the output, ctrl+a, ctrl+c, ctrl+n, ctrl+v to put in another script, ctrl+1, ctrl+a, ctrl+c the final result, done.

Final extreme feature of editplus are *.stx (syntax file) and *.acp (auto complete file).

The reason is very simple:
You can open a document (let’s say a new kind of custom log file you just created)
do some replace regexp (to get a list of keywords),
then split them by line, do a sort-reduce,
open an existing *.stx, save as… mylogfile.stx
paste the keywords you want.

There you go, you now have a genuine
new highlighted log file in 20 sec.
Very useful for “printf()” debugging sessions.

The only improvement I would suggest on editplus stx are that instead of hardcoding the color in sequence #KEYWORD= group, to let the user specify it,
possibly with regexp, like this:

#KEYWORD(red)=Error
ERR(OR)?
FATAL
CRIT(ICAL)?
FAIL(URE)?

#KEYWORD(green)=Ok
OK(AY)?
CORRECT
USEFUL

#KEYWORD(yellow)=warning
WARN(ing)?
DEBUG?
TRACE?

Samething for autocompletion:

Here’s how you create a new code template in 5 seconds
#T=class
class ^!
{
};

that will put the curson where ^! is located
and create the code when you type “class” + space,
ctrl+z undo the code generation.

A nicer feature would be to support this instead:

#T=class
class ^!
{
^!
};

So “tab” goes to the next ^!.

Or even better with regexp support:

#T=class
class (^!)
{
public:
\1\(\);
~\1\(\);
\1\(const \1&\);
const \1& operator=\(const \1&\);
^!
};

Nasty features huh! =)

Fred.

Manabu August 31st, 2007

I will look foward to it! :)

sping October 18th, 2008

Closing comments due to spam.