Archive for March, 2006

vi/vim Graphical Cheat Sheet & Tutorial

Wednesday, March 29th, 2006

Last Thursday, while waiting for a friend at the airport, I was having a look at an ad for a Blackberry. I watched the beautiful two-chars-per-key keyboard and the tiny screen (magnified by the magic of marketing to something much taller than myself).

Then it struck me: a keyboard map for vi/vim would be really cool to see! And it shouldn’t be too much work! I certainly would have loved to have it when I was learning vi/vim, not that long ago.

The result is here: vi/vim Graphical Cheat Sheet & Tutorial. I sure think it’s one of the best ways out there to get started with vi/vim.

It’s currently on the front page of reddit & del.icio.us, so welcome to all visitors from there!

As for some context, I only started using vim a bit over a year ago. The reason? I was fed up with the arrow/home/end/pageup/… keys on my laptop being a pain to use. So, I took up learning vim. Turns out it was love at first sight. Read the details here. I now use it anywhere I can, desktop, laptop, whatever. Ok, not anything, I think Blackberries don’t support it, and I don’t own one to begin with, but a vi/vim interface to the Blackberry would probably be very cool.

After this, I had to add vi/vim emulation to the text editor I’m developing – I wouldn’t have been able to test it without that. And once done, I thought it might work as a commercial add-in for Visual Studio, released last July. And it is working a bit: it seems there are more souls claimed by vi/vim out there.

A friend helped me do all the work, and we used the open source application InkScape to actually draw it.

It seems many people are visiting the cheat sheet & tutorial page – hopefully it will help them learn vi/vim, and it will also provide some nice exposure to ViEmu.

Although I don’t practice much proselitism in this aspect, let me state that one should look at vi/vim’s unique input model not as a relic from old times, but as a different UI model. Optimized for reducing keystrokes & maximizing editing power, both at the expense of the initial learning curve & operating simplicity. It doesn’t matter Bill Joy invented it in the 70s, if he hadn’t thought it up back then, someone would have to invent it today. Admittedly not for mainstream consumption, but I’d buy it as happily.

Rough strategy sketch

Wednesday, March 22nd, 2006

I think I promised a general strategy post & a status report, some time ago. Here goes.

Development strategy

I am currently sharing my efforts between two development efforts. One of them, ViEmu, has been available for almost 8 months now. It has improved, a lot, and sales have been steadily climbing. Although not a stellar success, it’s working well beyond my realistic forecasts (not beyond my wildest dreams), and I’m really happy that I decided to do it.

The second one, code-named NGEDIT, has been in development for a bit over a year, and it’s still not ready for release. In the time I’ve been developing it, both my belief in the concept, and my disrespect for my own time estimations, have grown a lot. I would be very happy to release 1.0 around July or August, one year after the release of ViEmu, but I know it’s still optimistic. And that’s after I’ve decided to cut out most of the stuff for version 1.0!

Of course, apart from these clear-cut fronts, and not including my day job, there are other fronts I have to attend. Customer support, for example, or this blog, for that matter.

I’ll try to summarize, in a general sense, what my current plans for the next few months are. What the main goals are, and how I’m planning to achieve them.

The #1 goal, as you can guess, is to release NGEDIT version 1.0. This is a bit trickier than sounds. The act of releasing it is, in a general sense, more important than the exact functionality it brings. I have come to this conclusion after over a year in development, and the experience of ViEmu. Emotionally, it’s much better to be working on improving an existing product than it is to be working on a product for its first release, with no users or customers. As long as you are not too impatient to get a lot of sales, having actual users & feedback is a big boost for motivation. Having a few sales helps, as well. And, as long as the product is good and there is a need, sales only get higher as you improve the product.

In order to get this process working, I’ve cut out many planned features from 1.0, in order to release it before long. You might ask, why don’t you already release it in its current stage?

A common answer, but not too informative, would be to answer that it’s still too basic, or unusable. Well, not completely true, as I use it. But a better answer would involve some thought on the market I’m getting in. The text editor market is pretty saturated, and most products out there have many man-years of effort built in. There is at least a general perception of things a text editor must have. I think releasing it without these features would be too much of a stretch. Rest assured, I’ve carefully removed everything which isn’t essential for 1.0. As with ViEmu 1.0, the first release will be pretty basic, but it will hopefully be a better tool for at least some people out there, and that should trigger the initial dynamic of usage-feedback-improvement.

Apart from these essential elements, NGEDIT 1.0 will also sport some interesting things that are well outside the minimum requirements list. The very complete vi/vim emulation, for one, or the native management of text in any format (no conversion on load/save). There are a few more, but these are probably the most interesting to talk about. There are two main forces that have resulted in this uncommon feature set. The first is that I’m building NGEDIT 1.0 as the core framework for the really advanced features, which have some unique requirements. And the second is that I’m building it to become my favorite editor first, and only then a commercial product. This results in the need of powerful vi/vim emulation, which is bound not to have much relevance as a commercial feature.

So, we could say the road to NGEDIT 1.0 is drawn by three guiding principles, listed in increasing priority:

  • III: Build a good foundation for the future versions of the editor, if not fully realized, at least following a scalable design
  • II: Release the minimum product that makes sense
  • I: Build my favorite editor

This is not a list of principles I try to adhere to. It’s more of a recollection of the kind of decisions I’ve found myself taking on intuitive grounds. I’ve seen that I will trade the best design for some functionality, in order to be closer to release, and I’ve found that I’ve traded every sensible business principle by deciding to implement some very complete (and costly) vi/vim emulation. The fact that my sticking to vi/vim emulation has resulted in ViEmu, which is a nice product, (kind of) validates the principles. Actually, I think it validates them because I find myself enjoying the effort, which helps in sustaining the long term effort, and the business is gaining momentum. Apart from this, the ViEmu experience has been an incredible sandbox where to learn, and the lessons learned will play a nice role towards the actual release of NGEDIT. For example, the Google SEO front, and also the adwords & clickfraud front.

In a general strategic view, I’m meshing my efforts on NGEDIT 1.0 with steadily improving ViEmu. Even if ViEmu doesn’t have the business potential of NGEDIT, I think that making all the customers of ViEmu happy only helps with the later stages of building the business. One thing to which I haven’t paid too much attention is marketing ViEmu. I think I could easily improve the sales performance of ViEmu with some effort, but I also think this efforts falls on the other side of the line “makes sense over working on NGEDIT”. So far, a bit of Google-tweaking, a bit of adwords, a bit of word-of-mouth, and a deserted market have been successful in building up sales.

This is very different from what I think I should do if ViEmu were the product on which I wanted to base my business. I would have to be working 100% in promoting it while steadily improving it. But, frankly, I don’t think ViEmu would be a sensible sole-business product. Not everyone is dying for vi/vim emulation.

So, what do all the above principles result in, as practical acting? The first point is that, for the past few months, I’ve been (a)improving ViEmu little by little and releasing new versions, (b)designing and working on the core architecture of NGEDIT, and (c)crossporting ViEmu’s vi/vim core to NGEDIT. The reason for the third point was that, upon using NGEDIT myself, I was sorely missing good vi/vim functionality. It already had some nice vi/vim emulation, written in NGEDIT’s own scripting language, which was the seed for ViEmu, but ViEmu had grown way beyond this seed. Thus, principle (I) kicked in, and I started to crossport ViEmu’s vi/vim engine.

Why do I say crossport? The reason is that I have been rewriting the core in such a way that it can be used both within NGEDIT and within ViEmu. This has had some major requirements on the design of ngvi, as I like to call the new core, and it’s a reason it’s taken some serious time to develop. This effort has some nice side effects:

  • I now have a super-flexible vi/vim core that I can integrate in other products, or use to develop vi/vim plugins for other environments (ah, if only solving interaction problems with other plugins weren’t the worst part!).
  • I can now put in work that benefits both products.
  • I’ll talk about it later, but I have come up with some neat new programming tricks due to this effort. The payoff for this will come later on, but it’s there anyway.

The new core is almost finished, with only ex command line emulation left to be crossported. For testing, this core is being used in NGEDIT. That way, ViEmu can advance as a separate branch. As soon as ngvi is finished, I will start implementing ViEmu 2.0 based on ngvi. This new core already brings some functionality that ViEmu is lacking, and I will be just plain happy that most of ViEmu is now officially part of NGEDIT.

And after this, I have a couple major features in NGEDIT that need to be implemented, and a gazillion minor loose ends. If you are an experienced developer, you’ll know it’s those loose ends that put the July/August release date in danger.

Names, names, names

As I mentioned recently, NGEDIT will not be the name of the final product. I already have the candidate for the name, and there’s only one thing pending before it becomes official: I need to check it with a Japanese person. I haven’t been very successful through asking here on the blog, or through asking the Japanese customers of ViEmu. Understandably, I haven’t insisted too much on my Japanese customers – they are customers after all!

I don’t want to reveal the name just yet, as I don’t want even more confusion if it ends up not being the final name. I would also like to have at least a placeholder page ready when I reveal the name.

Apart from this name change, I also intend to do something with the blog’s name. I plan to blog more and more in the future, as the business doesn’t critically require all my energy. I also plan to cover other areas: programming languages, software design, A.I., O.S.S., operating systems, I’d even like to write on things like economy or the psychology of programming! I think a more general name would be a good idea.

Given that the new editor will have its own new name, that I plan to move ViEmu to is own domain (viemu.com, already up with a simple page), and that the blog needs another name, ngedit.com will very likely end up pretty empty.

All that pagerank accumulated for nothing… sigh! In any case, now should be the best moment to do the deep reforms.

I’ll let you know as these names are ready for general exposure.

Tha blog

If anyone has been reading long enough, you will have probably noticed that I post less often that I used to. The main reason is that development itself already drains most of my available energy. There is not much I can do about that, except wait for days where I have more energy, and wait for the moment when NGEDIT is already released. I will feel much better when NGEDIT is out there, and I think I’ll be able to concentrate better on other things. Having put so much effort so far, and not having it available for download & for sale puts a lot of pressure.

But there are also other reasons. For one, I have many interesting topics I’d like to cover, but which I don’t want to cover just yet. I prefer to wait until I have a working product, before bringing up some of these areas. Should be better business-wise.

This ends up meaning that I don’t want to write about the stuff I want to write about. Ahem.

Anyway, I have come up with an area I’d like to cover with a series of posts. It’s about the techniques I have been using for the development of ngvi, which could be described as the application of dynamic & functional programming to C++. Part of the techniques will be applicable to C++ only, but many other apply to general imperative/OO programming. Hopefully it will be interesting to (some of) you.

Google *loves* the H1 tag

Friday, March 3rd, 2006

(The short version, in case you don’t want to read more: have H1 tags in your pages, containing the keywords you’re interested in. It pays off)

Isn’t it frustrating when your page doesn’t even appear in Google for your target keywords? It can be even worse:

  • you may not be targeting competitive keywords at all, and there may be no competing products at all.
  • There can be several other pages, about your product, and linking to your page, actually appearing on the results!

This is what was happening to me with the main page of my product, ViEmu. ViEmu provides vi/vim emulation within visual studio, so pretty obviously the target keyphrases are “vi visual studio” and/or “vim visual studio”. The product and the page have been there, accessible through http://www.ngedit.com/viemu.html since late last July. There have been quite many mentions of it, which link to that page, from blogs, review sites, etc… The page has been indexed all along, and appearing on the top results page of Google for things like “visual studio vi emulation” or, quite obviously, “viemu”. But it didn’t even register on the much more interesting “vi visual studio” and “vim visual studio” search phrases. By this, I mean it was nowhere to be seen on the first 40 pages of results or so. What’s even funnier is that many of the mentions of my page did appear there, even on the first few pages.

I have an adwords campaign (read my report on adwords for details on the effectiveness, click fraud, etc), which helps out, but I’d really prefer to be on the main results. What’s more, I couldn’t easily understand why I wasn’t.

Trying to understand how Google sorts its results is a tricky task, as well as a moving target. But I had an advantage: a certain review from Tobias Gurock over at Gurock Software was scoring incredibly on search results – it was on the first or second page of the results for the interesting searches! So I decided to have a look at it and try to find out why Google liked it so much.

The first thing to check, obviously, was whether that page had a significantly higher PageRank, or many more incoming links. Actually, it seemed to be about the same as mine (PR5), so that probably wasn’t it. Even other reviews, with much lower PR, did at least appear after page 3 or 4 of the results.

So that left the actual content itself. After some review, discarding the title, presence of the keywords, etc… I got it down to two differences:

  • The name of the html file, in their case, contains the keywords (it’s “http://software.gurock.com/postings/vi-emulation-for-visual-studio/25/”)
  • …and their H1 tag is “Vi emulation for Visual Studio” (today it also includes a self-link, but I think it used to contain just the text before they moved to WordPress)

Changing the filename was out of question – with all the links out there, I wouldn’t want to lose that. A 301 http redirect may be a possibility, but I was weary of Google consequences (I could make it even worse, possibly losing the accumulated PR).

But the H1 tag… see, my original web site design did not include an H1 tag at all. Along the product’s logo, I had a graphical rendering of the name – not leaving room for a text H1 tag.

So, I decided to “upgrade” those pages to having an H1 tag. The contents of the tag: pretty obvious, “ViEmu: vi/vim emulation for Visual Studio”. The text rendering of this title looked fine, so on February the 11th, I uploaded the new ViEmu pages. And started waiting.

Google comes often to my site (daily?), so that was fast. About a week afterwards, Google’s cache started showing the new content. So now I knew it was already there. The search results, anyway, kept on the same.

But around the 21st (last Tuesday), I found out to my grateful surprise that my page started appearing on the first results page, around #5. During all of last week, it was a bit unstable – some searches would work fine, but searching a few hours later would show the old results with my page nowhere. This week, finally, about 90% of the searches already show the new results!

I attribute the instability to the results requiring propagation around Google’s servers, which is expectedly a slow process. I’m guessing (and hoping) it will disappear altogether in a few more days.

Lessons learned? Always include a header in your design (I guess an image with alt text may work as well, but I’m not trying). Name the html files with the relevant keywords, not just with your product name.

And be prepared to learn a lot!