kde

Google Summer of Code 2011: A summary

0

Google summer of a code is an annual programme where Google pays students to work on open source projects in the summer months. The students have one or more mentors from the project who help them get started and function as a contact point for the developer community.

In 2008 I did a Google Summer of Code project for the Kate text editor where I wrote a Vi Input Mode – making it possible to use Kate in a modal, Vi[m]-like manner. The project was successful and I continued to maintain this code and added more features over the years. This summer I took the step of signing up as a mentor myself and put out a project proposal for further improving the Vi Mode in Kate and adding a good unit test framework for the code. To my surprise – and delight! – many students were interested in the project and we ended up getting quite a few applications from students wanting to work on “my” project. In the end the Russian computer science student  Святослав Кузьмич (Svyatoslav Kuzmich) from Moscow Institute of Physics and Technology was chosen.

The Kate Editor

Over the summer he wrote a test framework for the Vi Mode and wrote test for the functionality already present. Having an easy way of adding tests for the Vi mode had been on my wish list for a long time and it was really nice to see it implemented. It did not take long for the new test system to show its value: Svyatoslav found some corner case bugs that had probably been in the code for a long time and fixed them. A short overview of the new test framework can be found at the Kate blog: Kate Vi Mode Test Suite.

Svyatoslav also made many more visible improvements to the Vi Mode such as jump lists (making it possible to jump back/forward to where you were in the text), making it possible to control sub windows with the keyboard, many new command line mode commands and much more. An overview can be found in his blog post at kate-editor.org.

For me personally it was an interesting experience to act as a mentor for another programmer. My function also changed as the project progressed. In the beginning I tried to give Svyatoslav an overview of the current code and answer some questions as they came up. The programming work itself was rarely a theme – Svyatoslav was already a really good coder and generally just needed to be pointed in the right direction or – even more commonly – just get a confirming nod that his suggested solution sounded good. Since I had a few years to think about many of the features he wanted to implement I also had a few “that does sound like a good idea, but…” often learned the hard way. :-)

In the end the project turned out very well and the users will get many new features – some of which have been wished for for years.

As a wrap-up of Google Summer of Code 2011 I am going to San Francisco next week to take part in the GSoC 2011 mentor summit where mentors from the organizations taking part in the Summer of Code meet to exchange experiences and discuss future directions for the programme. I am really looking forward to that! :-)

Visual block mode for Kate’s Vi Mode

16

A block selected by visual block mode

One of the most oft-missed features of Kate’s Vi input mode is Vim’s visual block mode. Visual block mode is entered by pressing ctrl+v and allow a rectangular block of text to be selected and manipulated. Also, text can be prepended or appended to the block, which is useful for, e.g. commenting out a range of lines.

Well, good news, everyone! There is now experimental support for visual block mode in Kate’s Vi input mode. Most text manipulation commands should already support visual block mode, and prepending/appending text (shift+i and shift+a, respectively) works, and you can select to end-of-line with $, as in Vim. I also made it possible to re-select the last visual selection with gv, and the marks ‘<’ and ‘>’ are set to the start and end position of the last visual selection. (Further down the road it will hopefully be possible to use marks in ex commands, too.)

There are probably still some rough edges, but visual block mode should already be usable. If you want to help test it, build Kate from git and try it out.

Wish: Options for Kate’s Indenting Scripts

1

At the start of Kate’s indenting script for C/C++, the following options are available:

// BEGIN USER CONFIGURATION
var cfgIndentCase = true; // indent ‘case’ and ‘default’ in a switch?
var cfgIndentNamespace = true; // indent after ‘namespace’?
var cfgAutoInsertStar = false; // auto insert ‘*’ in C-comments
var cfgSnapSlash = false; // snap ‘/’ to ‘*/’ in C-comments
var cfgAutoInsertSlashes = false; // auto insert ‘//’ after C++-comments
// END USER CONFIGURATION

To set these options one would first have to actually find the indenting scripts under /usr/share, then copy it to one’s home directory to be able to modify it, and then modify the javascript source. This could – of course – be done in a much better way. In an ideal world options like these should be available in Kate’s settings as check boxes. It should also be possible to have non-boolean options, like choosing a value from a list of possible values for a setting.

I would love to see something like the following:

registerSetting(“Indent ‘case’ and ‘default’ in switch statements”, “cfgIndentCase”,  “boolean”);

produce

☑ Indent ‘case’ and ‘default’ in switch statements

in Kate’s settings.

I don’t have the time myself, but I don’t think it would be very hard, and I’m sure that many people would be a bit happier. Me and the other Kate developers would glady be of assistance. ☺

Kate’s Vi Input Mode — What will KDE 4.4 bring?

24

Please see http://kate-editor.org/kate-vi-mode/ for an updated overview of the Kate VI mode project.

Dear “Katevim” users.  Kate’s Vi Mode is steadily improving and I want to take a moment to tell what’s on the horizon for KDE 4.4. There has been quite a few bugs fixed since 4.3, but some major new features have also been introduced:

(more…)

How Kate got X-rated

4

(Ok, not really.)

Kate’s maintainer, Christoph Cullmann, shared a funny story over a beer one of the first days here at GCDS.

In ye olden days, what is now Kate and Kwrite was one application called “KWrite – KDE’s Advanced Text Editor”. However, the author of Kwrite mysteriously disappeared. Christoph forked Kwrite and continued working on it and after some time it greatly surpassed Kwrite’s capabilities and was becoming more of a power tool. A name change was long overdue.
Being a good German, Christoph decided to name it after the philosopher Immanuel Kant, so in KDE 2.1 the editor “Kant” was born.
For some strange reason, probably easier to understand for native English speakers, it was renamed to “Kate” in KDE 2.2. And thus what still is KDE’s Advanced Text Editor was born.

Google Calendar Plasmoid, Take Two

7

After the positive feedback on my quick 27 line python hack, I decided to make a slightly improved version. This fixes the two major problems with the old one: you can now use your Google Apps for your Domain email and you can use kwallet to remember your login.

gcal2

gcal_settings

It’s not a simple, 27 line python script any more, but now it’s much more usable. (unless there are some stupid bugs I have overlooked. :) )

As suggested I uploaded it to KDE Look: http://www.kde-look.org/content/show.php?content=104182, so you can install it from the “Add widgets…” dialogue or download it and install it with plasmapkg -i gcal-1.1.plasmoid.

(more…)

Google Calendar Plasmoid

17

Update: A new, better version can be found here:

http://hamberg.no/erlend/2009/05/07/google-calendar-plasmoid-take-two/

In case anyone is interested:

I made a simple Plasmoid for viewing coming events from Google Calendar. It’s simply a webview showing the iPhone version of Google Calendar. It’s written in Python and took 10 minutes to write (27 lines of code) by following the excellent tutorial on techbase.

gcal

You can download it here: http://hamberg.no/erlend/files/gcal.zip. If you improve it or make another Google Calendar plasmoid: let me know! :)

Oh, btw. To install it run plasmapkg -i gcal.zip.

P.S: openSuse users: I had to install python-dev to actually run a python plasmoid. Don’t know why.

Wikibooks, now also for us who like physical books

2

In “just” 19 days I’ll have completed my last exam for this semester and I can travel home for a nice, quiet Christmas with my family. As usual, I’ll travel by train, which takes 16-17 hours each way. Partly because it’s cheap (25 EUR), but most of all because it’s very comfortable and is a nice way to “stress down” after an intense exam period. As usual I’ll pack plenty of books and an iPhone with all the podcast episodes I have postponed listening to.

Among the new books I’ll bring there will also be at least one wikibook. Yes, a real, physical wikibook. :)
You see, I have been using the x86 disassembly wikibook quite often, and recently I read that there were a “a collection for print-on-demand publishing from PediaPress” available for the book. Being curious, I had to click the link to see what that actually meant…

It turns out that PediaPress will print a copy of a wikibook for a very fair price. It can even be your own compilation of parts of books (and Wikipedia support is coming, according to their webpage). Printing and shipping of the book (200 pages) to Norway was a little over 10 EUR.

I’m now sitting with three printed wikibooks in front of me, and the quality of the printed book are very good. Needless to say, I’m very happy. They even donate a portion of the proceeds to the Wikimedia Foundation (though, they don’t say how much).

Shiny new books

Shiny new books

Okteta

Okteta is of course mentioned :)

The Vi input mode for Kate is “done”

68

Please see http://kate-editor.org/kate-vi-mode/ for an updated overview of the Kate VI mode project.

I just marked the Vi input mode (“V.I.M.”? :) ) for the Kate kpart as done in the feature plan for KDE 4.2. It feels a bit weird to mark it as done, though, as there are tonnes of things I want to implement after KDE 4.2.

As you may know this started as a Google Summer of Code project and I’m quite happy with the way things have turned out. Since we are in feature freeze I would like to present the features that will be in the Vi input mode for the Kate part in KDE 4.2.

Kate Vi Input Mode in action

Kate Vi Input Mode in action – visual mode selection

(more…)

GSoC is over: The state of Kate’s Vi input mode

2

The Google summer of code programme’s coding part officially ended this Monday. That won’t be the last you will hear from me, though. Kate’s vi input mode has turned out to be quite nice, and there are lots of improvements I want to do in the coming months. The biggest news are a visual mode + visual line wise mode. Visual mode is one of those things that really make vim stand out from all of the vi clones, and having support for it makes Kate’s vi input mode it much more usable for me. (more…)

Go to Top