Kate’s Folding Code and Vi Mode to be improved by GSoC students

This year’s Google Summer of Code (GSoC) has started and the Kate project has been lucky to get two students who will work on improving Kate’s folding code and Vi input mode.


Adrian will work on improving the folding code which is in need of an overhaul:

My name is Adrian. I’m studying in Bucharest, Romania, but my hometown is Constanta, a seaside town from Romania as well. I am a 3rd year student at “Politehnica” University of Bucharest, majoring in Computer Science and Engineering. I have developed a passion for algorithms since High school when I participate in many programming competitions and took things to a new level during college.

My GSoC project is called “Kate Code Folding” and I believe its name is quite explicit.  I chose this project because I am very familiar with the editor, as well as its code folding bugs. :)  Besides that, I am pretty excited that I have to develop a new algorithm for this project and I must say I find this task very challenging. For a better understanding of my project, here there are 2 paragraphs from my proposal, with no details, just the main ideas:

My project idea is based on two elements. The first one is a new approach of the problem: transform one more complex problem into two simpler problems. To be more specific, as far as I know there are two types of programming languages: there are languages that use syntactical elements like {} or any other begin/end constructions (e.g.: C/C++) and there are languages that use indentation level to define their code blocks (e.g.: Python).

The second idea is to have the new implementations compatible with the current one. What I mean is that most of the actual public functions will still be used in the new implementation (some of them will suffer a few modifications), to solve the dependencies problem in a smart and simple way. So there won’t be too many changes in the other source files.


Svyatoslav will work on improving the Vi input mode in Kate:

I am Svyatoslav Kuzmich. I’m a 2nd year student of Moscow Institute of Physics and Technology, department of Radioengineering and Computer Science.I usually write something like emulators and compilers but this Summer I am doing GSoC for KDE. I want to improve Vi input mode for Kate kpart. There are a lot of features already implemented. In some ways they works rather good. But there are some commands do not work like commands in Vim. So I want to fix them and to expand the list of commands by adding some insert and command mode’s commands for working with Kate’s tabs, window splits and bookmarks.

In more behind-the-scenes work, Svyatoslav will also write an extensive test suite for the Kate Vi Mode to make it easier to introduce new features without at the same time introducing regressions. This work has already begun.

We will try to keep you updated throughout the summer. Please wish our GSoC students good luck! :-)

10 thoughts on “Kate’s Folding Code and Vi Mode to be improved by GSoC students

  1. Great News !

    Regarding the Kate Vi(m) Mode will you consider some key bindings to navigate between window splits (like CTRL-w left, CTRL-w right, CTRL-w up and CTRL-w down) ?
    Do you think it could be possible to have completion in the command line like we have in vim to complete for example the path of a file to open or to complete some command arguments ? It could greatly enhance the Kate Vi mode IMHO.

    Adrian and Svyatoslav, I whish you the best for your GSoC !

    1. To implement this is also rather easy. Once you have the vim bindings, you have to do the following:
      1. find all visible KateViews
      2. compare the global coordinates of the window geometry by using QWidget::mapToGlobal(const QPoint& pos) (for QPoint(0, 0) and QPoint(width(), height()))
      3. call setFocus to the nearest of the visible views.

      Again, patches are welcome, see http://kate-editor.org/get-it/

  2. Thanks a lot!

    As for windows splits I want to implement some commands for normal mode:
    and some command mode commands:
    :split, :vsplit:, :hide, :nly.
    Maybe you remember some other useful commands? I don’t use others in vim :)

    Code completion is great idea, maybe i’ll think about it if i’ll have time.

    1. Completing arguments while typing:
      1. Derive your KTextEditor::Command [1] inheriting class also from KTextEditor::CommandExtension [2]
      2. reimplement CommandExtension::wantsToProcessText(cmd) and return true
      3. reimplement CommandExtension::processText(view, text) and return a list of possible completins.

      So it’s already possible now, and even quite easy. Just read [3] and give use a patch!

      [1] http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1Command.html
      [2] http://api.kde.org/4.x-api/kdelibs-apidocs/interfaces/ktexteditor/html/classKTextEditor_1_1CommandExtension.html
      [3] http://kate-editor.org/get-it/

  3. Nice. I’m especially interested in the Vim behavior. I have never used vim before, and don’t plan on doing it. But I am currently learning the kate vim bindings, and I like the way (vim) acts. It’d be awesome to see those features be improved, as all I know of vim is through whatever kate gives me. Please be sure to document it though, I hope that the vim bindings on this website are up-to-date, since it doesn’t support everything, and it’d be nice to know what I can do with it. I’m actually printing out the bindings now, to learn it. :)

  4. Thanks Erlend for presenting your students who seem highly capable! I wish Adrian and Svyatoslav a good time in the KDE community and thanks for making Kate rocking even more!

  5. glad go see vi even better implemented in KDE. I hope Svyatoslav finds the time to look at block selection mode crtl+v, that’s probably what I miss most in the current implementation. Good luck and have fun :-)

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top