All posts by Dominik

Dominik is a PhD student at the Control Theory and Robotics Lab, TU Darmstadt, as part of the Research Training Group GKMM (GRK1362). My research focuses on state estimation in distributed systems. As hobby, I contribute to the KDE project and work on the Kate application and editor component.

Color Settings

This week, Kate Part received an update of the “Colors” tab in the settings dialog, available in KDE 4.9. The major features include

  • configurable colors: search highlight, replace highlight and modified line colors – finally :-)
  • possibility to always use colors from the KDE color scheme.
  • the implementation works in a way that at some point, the host application (KDevelop, Kile, …) can put items into this list.

Here are screenshots of the new (top) and the old (bottom) color tab:

The new implementation uses a QTreeWidget along with a custom delegate to draw the colors button and reset icon. It would be nice to have an appearance of the categories like in systemsettings, or like in dolphin. Dolphin probably uses a KCategorizedView, which in turn uses KCategoryDrawer. KCategoryDrawer could be used, but needs fine tuning in order to make it look nice. Does someone know how systemsettings draws the nice shaded backgrounds of the categories?

Disable Line Modification Indicators

On KDE 4.8.0, there is no way to disable the line modification markers.

In KDE >= 4.8.1, you can disable them as follows by first closing Kate and then typing

kwriteconfig --file katerc --group "Kate View Defaults" --key "Line Modification" --type bool false

To enable it again, close Kate and run

kwriteconfig --file katerc --group "Kate View Defaults" --key "Line Modification" --type bool true

However, this only affects Kate; not KWrite, Kile, KDevelop or any other application using Kate Part. If you want to disable the markers for KWrite, Kile or KDevelop, use kwriterc, kilerc or kdeveloprc instead of katerc.

In KDE >= 4.9, there is a graphical option in the editor configuration dialog in “Appearance > Borders > [x] Show line modification markers”.


	

Scripting in Kate

Since several releases, Kate Part has scripting support through javascript. So far, it seems it is not much used by users. Still, I stumbled over two extensions:

If you have more user defined scripts, it would be nice if you let us know! For KDE5, we plan to extend this, so applications like Kile or KDevelop can reuse Kate’s internal code.

On another note, here is a nice blog about the upcoming KDE 4.8 release :-)

Highlighting Search & Replace Matches

In response to Kate in KDE 4.8, there was this reply on reddit:

Does this mean the stupid search/replace functionality has finally been fixed?

Once the search/replace marks/colors text there’s no way to clear it so when you’re replacing keywords the last one will be permanently marked with background color unless you reload the file or search for something else… Infuriating.

It’s about the yellow / green background for search matches / replace items. But stating that you have to reload the file in order to remove the highlighting is completely wrong. If you dislike the persisting highlighting, just press ESC, and it is removed (yes, this is by design, and imho very useful).

There is a pretty good book called The pragmatic programmer, and one rule of thumb is

Use a Single Editor Well

The editor should be an extension of your hand; make sure your editor is configurable, extensible, and programmable.

How true! :-)