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.

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.

Qt Creator

Well, since everybody is doing it, I too wanted to share my wisdom about the technology preview version of Qt Creator.

I will not write about the Qt Creator vs KDevelop relationship since KDevelop was never my scene. Tried the KDE3 edition once (a long time ago), and it just didn’t work for me (not only because of all the crashes). After that, I turned to Eclipse for C++ development because of its plugins, mainly the Subversion browser. I even set it to work with CMake properly, and to run KDE4 applications in their own environment. But, after awhile, I got tired of the slowness and of compilation errors related to ‘:w’ everywhere in the code, so I decided to return to Vim and to make an IDE out of it, but that is another story.

Qt Creator

At first I just downloaded it, started, and closed it almost immediately. Why? It looks too fancy for a real developer’s tool. Shiny run, debug and build buttons, etc. and a large Nokia logo. Why do I need that, I really don’t know.

Then, I decided to give it a second chance and start a small, but real project. The interface, although too fancy for me (remember, I use Vim) isn’t all that bad at all. It is pleasant and fast (unlike most IDEs today). I will not repeat Aaron’s stances on the subject – I mostly agree with him – I’ll just point a few other things that I did or did not like.

Pros

Well, I have nothing to add what was not already said – UI is clean, it is fast, it has a quite a few nifty features…

Cons

If this sounds too harsh or rude, I apologize, it wasn’t my intention, just trying to say what I find peculiar about the IDE.

I like keeping my code organized. I like having subdirectories, and subdirectories of those subdirectories etc. How to do that in Qt Creator? Well, to be honest, there is no way (at least not yet). You can organize your files the way you want, but Qt Creator will show all of them in a list. So, what is the point of organizing them? And what is the point of the Project browser if you get a list of a (potentially) few hundred files?

Then, you want to add a class to your project. You right-click the project in the project browser, and get an option to add a new file. OK, lets go for that. Here you get to create a ‘C++ Header file’ and ‘C++ Source file’ (amongst other non-relevant options for this task). OK, so we need to create them separately… but I know I saw somewhere an option to create a C++ Class… huh… let’s try this: File > New… Oh we get the SAME dialogue as the one we had earlier, only now we get to create a C++ Class as well. Strange.

Epilogue

I don’t want to sound like I hate the software, because I don’t – it is really cool, but I wanted to take it a bit more seriously than just ‘uh, a new toy, I must try it’. It has a potential to become a really good development environment, but has a really long way to go before it does.

And for the end, Trolls*, good job so far, now just finish it ;) .

* Hmmm, since it is no more Trolltech but Qt Software, should we start calling them Qties (Cuties) instead of Trolls? :)