Skip to content

Tree View plugin introduction

Friday, 10 September 2010 | Thomas Fjellstrom


Kate has been my favorite editor for some time now. And only recently has it not been able to do something I asked it do to. I was working on a rather large project in Perl when things started getting confusing. The classic file list had 50+ files in it, some of them have the same file name, so would have (1) or (2) or even (4) after the file name, and while thats handy, it gets confusing pretty quickly.

So I spent a week to try and bring order to the chaos. And this is what I came up with.

Now I can tell people are thinking, but Thomas, that doesn’t look so confusing.. Granted.

Here’s what my larger project looks like with the file list:

I think anyone will have a hard time working with that unholy mess. After trying to manage that for more than a couple of days I sat down and decided to write the tree plugin. Heres what the mess looks like now:

Is that not a lot better?

Some of you reading this might have noticed that it isn’t creating a full file system tree. That is it isn’t making “/” or “C:” the root of the tree. Indeed. It uses a couple tricks to make sure the tree isn’t cluttered with directories you really don’t care about. If people are interested I can explain more about how it does what it does in a more technical post.

I’ve heard a few people ask if this shouldn’t just outright replace the existing file list. The Kate developers don’t see why not, but I have my doubts that it is a proper “one size fits all” solution. As far as I can tell, it is impossible to make the tree behave in a fully sane and expected manner. In some cases it won’t merge some folders you think it should, but (IMO) trying to make the tree behave any “better” would make it less useful (at least to me). I’m interested in what people think, is it “good enough” to become the default document list, or even replace the existing one outright?

I’ve committed the plugin to KDE svn, and just uploaded to kde-apps if anyone is interested in giving it a try. I’ve tested it with Kate/KDE 4.4, 4.5, and Kate from trunk. Please let me know what you think, and tell me if you have any problems or concerns! Thanks :)

p.s. I’m new to this whole blogging thing, please be gentle ;)

Tags:  planet

See also: