This is purely an exercise in self improvement and education.I am trying to implement an extension for a vi-like text editor within a browser. Can anyone give any advice or pointers as to where and how I should start?
Short Answer: There are number of open-source text editors in the market. I would grab one and look at their code base. Improve it if you can, and share back with community.
For example, if you are using a CMS based framework system like Joomla, you may look at variety of editor tools here.
Writing an editor to run inside a browser is not that different.
<div> to render your buffer; when you update its contents or alter styles of elements inside it, the browser will repaint it for you. Quite probably, in a line-oriented vi-like editor it's convenient to have every line in a separate nested
onclick and other such event handlers to react on user actions.
The rest is up to you.