Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-text-dev] creating an editor "scheme" for jVi

This message is similar to a post I made to news:eclipse.platform yesterday, before I found this list.

I'd like to port jVi, a vi/vim plugin, to eclipse. jVi has been available as a JBuilder plugin for several years. I'm new to eclipse and I haven't used java for some years, so... I'd like some pointer and some general review/check on direction. I haven't downloaded any eclipse code (yet).

A jvi project really shouldn't need to get into the guts of the editor, being invoked with keybindings, but if the JBuilder experience is any indication issues will arise. If there is a better newsgroup/forum to discuss this project, please let me know.

The ...ui.binding doc suggests that scheme/keybindings is the way to go. The jVi swing port uses Keymap so this fits ok. The jVi code is based on the vim "C" code; jVi does its own parsing of commands, it does not use specific keybinding to invoke different commands. Well known IDE actions, eg Ctrl-Space, are still dispatched through keybindings. Also, vi is modal; when in command mode, almost every key can be part of a command and must be delivered to jVi. The swing Keymap has setDefaultAction, is there something similar I can do here programatically? (The comment about "...no public API for defining..." leaves me in doubt)

One part of this project is to port jVi to SWT components, for debug I'd like to set up a simple program using the SWT interfaces and classes I'll run into in the IDE. Presumably I'd have to set up keybindings programatically. This should all be straightforward? Though I did see a comment in the "Platform Text 3.2 plan" about untangling AbstractTextEditor from eclipse.ui internals. If that means I can't get hold of an ITextEditor It seems I'm out of luck; I guess I'll have to run eclipse under the debugger? Is there some doc/guide on that?

Starting with window.getActivePage, I couldn't see how to get to the SWT widget, presumable Styled Text. I'm assuming I'll need that to do scrolling half and full pages forward and back, and probably other stuff. I thought I'd be able to get there from IView, but I didn't see it.

Since vi is modal, if the IDE editor has some behaviors that trigger off of keystrokes they need to be disabled while vi is in command mode.

For both context and scheme is there a way to get a look at those instantiated and their parent/child relationship? Just for my own info.

jVi will also want to invoke well known commands programatically, eg undo/redo, I assume that is possible. What's a good way to find out what the available commands are and what they do.

-ernie



Back to the top