Tag Archives: planet

Kate Vi Input Mode – GSoC 2011

I want to introduce you my GSoC-2011 project. I was working on improvement the vi input mode for the Kate part.

There are a lot of improvements for normal mode. Now it’s able to use jump list by pressing ctrl-i/ctrl-o in normal mode like in vim. And now not only registers but also marks, and jumps stored in the config of the session. H, M and L commands moves cursor to the first(Home), Middle and Last line of the screen. To go to the any percent of the document you can use the % command by typing the number of percent(1-100) before it. gk and gj motions will make you able to go visual(display) lines up and down. It’s useful when you using line wrap.

You can split the screen vertically and horizontally by ctrl-s and ctrl-v shortcuts and move around them in different directions using ctrl-w{h,j,k,l,w} or also ctrl-w{←,↑,↓,→}.

In insert mode added commands ctrl-r+[register] to insert the contents of a register and ctrl-o to switch to the normal mode only for a one command and automatically get back to insert. The ctrl-a, ctrl-x command now increase and decrease the negative numbers too.

There are also some new command-line features. Now you can use the marks for a command ranges. It’s possible to add and subtract line numbers in the ranges many times. For example command :.+3d will delete the third line after current position and the command :’a,’b-1y will yank the line-wise range between the line of mark ‘a’ and the one line before the line of ‘b‘ mark.

Also there a some new basic vim commands:

  • :d or :delete – delete range;
  • :c or :change – change range;
  • :j – join all the lines in range;
  • :> – indent range;
  • :< – unindent range;
  • :y or :yank – yank range;
  • :ma or :mark or :k – set mark;
  • :bn – switch to next buffer(document);
  • :bp – switch to previous buffer(document);
  • :bf – to first buffer;
  • :bl – to last buffer;
  • :b [N] or :buffer [N] – to Nth buffer

Text objects are also improved and fixed. There are new objects: ( a{ , i{ , a< , i< , a` , i` ). And now they normally works with nested objects. So for now the i( object (for position of multiply symbol *) will be “(1*2/(2+3)–4)” instead of “(1*2/(2+3)–4)”. Some of the objects like (),{},[],<> works with several lines.

Visual mode now is integrated with mouse, so the mouse dragging starts the visual mode. All kind of Kate-way selection is also starts the visual mode. For example if you use “Select all” menu line or shortcut ctrl-a(by default) this will starts visual mode with the selected text and waits you for a command to execute :) . One point mouse click will exit the visual mode. Kate selection and vi mode selection is actually the same thing now. So you can, say, to select a bloc by using the Visual Block mode (ctrl-v), to do a context menu on them and to copy them to a clipboard :). When you exit visual mode the ‘< and ‘> marks have a start and end position of selection. It useful when you want to execute some command line command on the selected text. Just press the “:” when you select something and it automatically fill the command line with “‘<,’>” to have a quick access to selected area.

Vi marks and Kate bookmarks are integrated too. If you set the mark then this line becomes bookmarked by Kate. And vice versa: if you set a Kate’s bookmark and there no vi marks on this like vi mode sets the vim mark on this line and zero column, and shows you what letter for this mark is used.You can see the position of all vi marks in the bookmark menu in the menu bar or also in the context menu.

I hope this features will make you feel even more comfortable while using Kate. You can try it now in the git version of Kate.
Any notice or bug report are welcome !

You, KDE!

For me, it (still) feels very unnatural to talk about us as KDE. I’m still thinking in terms of the KDE community; and the KDE Project releases the KDE Desktop (or just KDE). I’m also fine with the KDE Workspace and other specialized variants. However, the login manager now also shows the term KDE Plasma Workspace. In my very own humble opinion, this is already too much of buzz words.

At university, I’m helping out with system administration. And since I’m very familiar with KDE, I fix all KDE related issues (and usually enjoy doing so). We have lots of colleagues that never used KDE. Now, try to explain the term Plasma… Well, it’s a desktop shell – also too complex. It’s the desktop, with all the icons and panels. That’s more understandable :) But next, a dialog pops up with some status messages: Akonadi. Well, try to explain the term Akonadi. It’s similar with other technologies. Explain what Nepomuk is doing with the difference to Strigi… When I try to explain what’s happening, and what all these components do, I sometimes feel pretty much stupid uncomfortable using these words.

It is similar with the term KDE SC. As part of the rebranding, the KDE Software Compilation or short KDE SC was introduced. I can understand that we build a platform and our target is more than just the Desktop. But talking to other people, I feel stupid saying KDE SC. For me, it simply is (and probably will always be) a no-go. But it changed already, to the KDE platform, or maybe I misunderstood that ? :-)

Funnily, I think it’s fine to use application names such as dolphin, kate, amarok and what not. So to some degree, I’m certainly simply used to these terms. But still, it feels right, also when talking to other users. We have to be very careful to use fancy names in very prominent places. Ah, and with respect to naming applications, there is a similar discussion on kde-core-devel right now ;)

Kate Modeline Editor

As you may know, Kate supports the concept of document variables, also known as modelines. In short, document variables can be used to set Kate settings local to a file. For instance, this is useful for settings specific indenter options than the ones defined in Kate’s settings dialog. Assume you work on two projects, the first indents with spaces and the second with tabs, then you can simply add a modeline that contains the specific document variables that set the specific indentation properties.

While the concept is very mighty, it is not intuitive to use: You have to know the exact syntax and correct varialbes and their valid values.

To improve this for the next KDE release (v4.8?), Kate gained a variable / modeline editor this week:

If you click the Edit button, a list view pops up showing all valid document variables with the valid values. Right now, this editor is included only in the “Modes & Filetypes” config page. However, the idea is to support it in the context menu over a Kate modeline in the text editor area as well.

KDE 4.6.5 > StarCraft 2

I normally enjoy StarCraft 2 in the evening a bit or like now, if it is raining and I have no fun in any more real work.

But just now and some days ago, it has again proven, KDE > StarCraft 2.

Just again, StarCraft 2 (played with wine, thanks a lot wine team, you do a great job!) got sluggish and then terminated.
A quick dmesg call shows the cause.
Like last time, the OOM killer got me.

Now, first I thought: What, this stupid game uses more than my 4 GB of RAM? (I have no swap, have only one ssd)
But now, the reason is much easier: KDE has beaten StarCraft 2…. (even if we call it KDE SC, it still not loves SC 2 :)

Looking at my process table, is is just clear: StarCraft 2 is the biggest memory user, that is just normal, around 2.5 GB, at peak.
But no reason to crash, or? With 4 GB.
But wait, I let my kontact run the background, big failure.

My stats here:

Kontact and co, just only taken the > 50 MB RSS offenders, there are lot of other smaller processes running around:

cullmann 1452 2.1 10.7 1243552 436228 ? Sl 11:05 9:33 /usr/bin/kontact
cullmann 1132 0.5 9.6 813136 391996 ? S 10:38 2:33 /usr/bin/akonadi_nepomuk_email_feeder –identifier akonadi_nepomuk_email_feeder
cullmann 1127 2.6 1.3 550532 54860 ? Sl 10:38 12:13 /usr/bin/akonadi_imap_resource –identifier akonadi_imap_resource_0
cullmann 1060 2.0 2.8 481124 114288 ? Sl 10:38 9:34 /usr/bin/mysqld –defaults-file=/home/cullmann/.local/share/akonadi//mysql.conf –datadir=/h

Summa around 1 GB, with the smaller ones.

+ my friend the semantic desktop :/
cullmann 1104 41.6 2.1 168752 88320 ? SNl 10:38 193:59 /usr/bin/virtuoso-t +foreground +configfile /tmp/virtuoso_hX1095.ini +wait

The planet is no place for bugs, I know, but anyway, this is no bug report. What should I report at all? That just using KDE + Kontact eats >> 1 GB of my RAM and virtuoso around 40% of my CPU? And yes, it even uses that with Kontact shutdown and all other apps closed… And no, I have no indexing active, that OOM’d me last time, even before Kontact + Akonadi on :/

I kind of think, we need to improve in that area, really.
Beside, in the old days, if Kontact did take too much RAM, I just closed it, now, still the akonadi parts + mysql stay alive, with around 1/2 GB memory usage :/
Guess need to kill them hard before starting to play :)

A lot of persons at work switched back to GNOME or whatever, because we can’t get rid of these problems. Either kdeinit eats our CPU (with Ubuntu Natty) or nepomuk/strigi/akonadi and Co. eat the memory + fill our NFS homes :/ And no, we don’t do bug reports for this, as these are not reproducable problems. (Beside the memory usage I guess and that virtuoso runs amok, but that are known issues if you look at our bug tracker)

Good side of things: In that light, Kate’s memory usage is kind of non-existing in comparison :P

I will continue to use KDE for sure and try to be more clever and shut down Kontact and co before playing (and turn of nepomuk completly, even if I get here and then a error message because of this) or I will just buy more RAM, 4GB to ease the pain should be not the biggest issue. Happy enough, at work I have anyway 8GB or more in every workstation because of our static analysis software needing it ;)