You are using an obsolete web browser, or you have the page styles (CSS) disabled. You'll be able to access this site, but only a visually simplified version.

First activities client application

At last Tokamak (Plasma developer sprint), I’ve made a small KWrite proof-of-concept patch just to see how it will behave with the new activities framework – notifying system when it opens and closes a document. A lot of time has passed since, and activity classes were completely revamped, turned upside-down, went through one API review, and moved from the playground to kdebase/libs.

That original patch doesn’t exist anymore, and even if it did, it wouldn’t work for all the changes that were made to activities.

The uber-awesome KDE conference – aKademy – was a time for something new!

New client

Ok, after this introduction you’d expect that I’ve written another patch for KWrite. Well, you’re wrong. The first application that supports activities as a client is Vim! :)

The main reason I went for Vim this time was to prove that non-kde apps can work with our awesome concept of activities. Another reason is that I didn’t want to use KActivity* classes, so that I can see whether the d-bus protocol is sufficiently profound for this task. It turned out that it is, but there are some improvements to be made.

At the moment, only Vim invoked from a terminal emulator program (eg Konsole) can work with activities since I can’t find a way to retrieve the window id of a GUI-enabled Vim from vimscript, so I’m essentially using WINDOWID environment variable that terminal emulators set.

The following is a debugging output of the activity manager daemon related to Vim windows

resourceWindowRegistered: 54526034 file:///home/ivan/mailacc.txt
resourceWindowUnregistered: 54526034 file:///home/ivan/.vimrc
resourceWindowRegistered: 85983274 file:///home/ivan/
resourceWindowRegistered: 85983274 file:///usr/share/vim/vim72/doc/options.txt

Truly limitless possibilities!!!

^^^^ just wanted to write an awesome marketing-speak sentence for the end of the post :D

It’s all text!

Just to share with you something I’ve stumbled upon.

A Firefox plugin that allows you to use your favourite text editor
for filling up the text areas in a page. It can be found at
https://addons.mozilla.org/en-US/firefox/addon/4125

This post, for example, was typed in Vim!

VIDE (Vim with Qt Creator’s Quick Browse and more…)

As you probably don’t remember (it was a long time ago), I was inspired by one Qt Creator’s feature – namely the Quick Browser – which I wanted to add to Vim. I haven’t touched it in a while due to lack of time and the promise of Vim emulation in Qt Creator. Since I find the Vim emulation in QtC not mature enough (I’ll leave commenting the final QtC 1.0 for some other time), I decided to continue working on the Vim with Runners project, or VIDE, the Vim IDE.

Vim has many plugins available at www.vim.org/scripts/ but the thing that I find annoying is that most of them are not really meant to work well together. So, for example, the Project plugin and the tag browser plugin open separate panels instead of sharing the same one, thus using too much screen real-estate…

Vide Logo

Before I begin, I would just like to note that Vide is still in its infancy and not all things are yet working properly, or at all. To see what does work, keep reading.

The point of Vide is to provide some standard framework for people who want to use it, so that a greater integration can be achieved. It is written in Python (so Vim with +python compile-time option is required) so writing new runners is a breeze.

The runners (the name is taken from the Plasma project) are meant to provide results for the entered query. The difference between plasma’s runners and the ones in VIde is that Vide activates only one runner at a time. Personally, I find that to be a better solution in this case. To choose the runner you want to use, just prefix the query with the runner’s key. For example, to find a file in the source tree that contains ‘vide’ in its name, just enter “f vide” as the query (“f” being the key of the Find runner)

Runners

To open the Vide panel, press Ctrl+A (this can be changed, but I’ll cover that later)

Quick Browser

The Quick Browser is invoked with the ‘qb ‘ prefix, but since it is the default runner, you can omit the prefix, and enter only the class name you are searching for. For example, if your query is “Butto” (or “qb Butto”), you’ll get all classes named Butto. The Quick Browser uses a CTags file to retrieve the list of matches, so you need to keep the ctags file updated.

Currently, the only way to recreate the tags file is to call :QuickBrowserReloadTags but that will change soon. Vide is going to provide a quick automatic regeneration of the tags file thanks to the iNotify (optional – set via the vide project configuration file).

Apart from CTags, QB runner supports PTags (for python). Note that you need to have the ptags.py in your path for this to work.

Find and Grep

The other two existing runners are Find and Grep, whose keywords are “f” and “g” respectively.

Project organization

In order for Vide to be loaded, firstly you’ll need to add it to vim’s plugins, or do a manual :source /path/to/vide.vim. You can freely do the former one since Vide will not bother you if you’re not working on a vide-enabled project.

To make a vide-enabled project, you’ll need to create a .videproject directory in the project’s root. There is no UI for this at the moment, so it needs to be done manually. You have an example .videproject directory in the SVN (Vide contains its own .videproject – it can be used for other projects aswell).

When you start Vim (and load vide.vim script) it will check for the .videproject directory in the current working directory, and if it doesn’t exist, it will not be loaded, and you’ll get your regular Vim.

If the .videproject is found, with all necessary sub-items, Vide will be loaded. The another thing that is important to mention is that you can place Vim plugins/scripts inside the .videproject/plugin subdirectory – if you need those plugins only for that project.

Well, that is all for now, the project is located at http://sourceforge.net/projects/vide/, so you can grab the sources from the SVN there. Just note that it is not finished – this is just a pre-alpha-tech-preview-release :)

If you have any questions, feel free to ask.

Vim and Qt Creator’s Quick Browse

Although this is not much related to KDE, or at all in fact, I decided to post it on my KDE development blog simply because there are so many KDE (and other) developers using Vim as their main (and only) IDE.

As I said earlier, I am a Vim fan, and I can not see that it will change in the foreseeable future. But, I have to say that, although I don’t find it a complete replacement of Vim’s Project plugin, that Quick Browser of Qt Creator is a very nifty feature.

So, I decided to start writing a Vim script which will emulate the Quick Browser behaviour. And so it started. The first version was a proof of concept one and it was designed so that the quick browser showed its results in a side panel (just as the Project plugin does).

And it worked quite fast.

The problem was that the Project, Code Navigator and my Quick Browser couldn’t work together very well – each one wanted it’s own window/buffer. So, I decided to start writing a simple Python (yes, Vim now supports Python scripting) framework that allows multiple plugins (called runners – took the name from Plasma/KRunner and I’m not ashamed) which are based on that framework to work together in harmony.

The project waits approval at SourceForge under the name Vide (obviously short for Vim – IDE). Currently only Quick Browser runner exists, but I’ll add more later.

Project management

And, that’s not all. There will be project meta-data which will allow you to define different build tools (cmake and qmake come to mind), …, and everything else I come up with… Since I’m bored and have to take my dog for a walk, this is all for now. So stay tuned.