Much as I love the convenience, though, I'm not willing to give up the powerful Java & C/C++ editing features of Eclipse: outline view, type hierarchy, continuous build, among many others. Given this dilemma, what is a developer to do?
Thankfully, Eclipse is an extensible IDE/platform and creating plug-ins has never been easier.
So I did the next best thing: I tried to create my own plug-in that emulates vi inside the Eclipse IDE (specifically, inside the text editors).
So, let me introduce to my own (pre-alpha) version of the Eclipse vi plug-in.
Here's how to install it:
- Inside Eclipse, go to Help->Software Updates->Find and Install...->Search for new features to install
- Click the New Remote Site button. Enter the information below when prompted:
- Name: Eclipse vi plug-in (or whatever suits you)
- URL: http://eclipseviplugin.sourceforge.net/update/0.x/
- Click Finish. Eclipse will try to download the plug-in from the above site.
- Once the download is finished, you will be asked to select the features to install. Just select All then hit Next.
- Accept the license... blah blah blah.
- Next. Then Finish. You will be prompted to restart Eclipse shortly afterwards. Please do.
- After restarting, try opening a text, Java, or C/C++ file.
- Press Ctrl+4 (my temporary equivalent of vi's
) inside the editor to go into vi command mode - From command mode, you can press i (insert), a (append), or o (insert line) to go back to edit mode. Or just click the mouse anywhere inside the document.
Mind you, it is still pre-alpha (v0.0.1), and thus sorely lacking in features and probably ridden with bugs too. If you find some, please don't hesitate to report it in the project's Bugs or Feature Requests page. Please be kind as I am only doing this in my free time :-)
Here are some of the other commands that work so far:
- :w (save)
- :wq (save and close)
- :q (close)
- w (next word)
- b (previous word)
- $ (go to end of line)
- ^ (go to start of line)
- % (find matching bracket - you need to be in a Java or C/C++ editor for this)
- most navigational keys (h, j, k, l and arrow/pgup/pgdown keys)
- delete commands (x, dw, d$, dd, db)
- u (undo)
- Find commands (/, ?, *, #)
- Repeat previous command (.)
- Command count (e.g., 3x to delete 3 characters)
- Other neat vi features
- Text editor (UI) enhancements such as status line, popup dialogs, preference pages, etc.
- Help pages
In the next posts, I will try to document some of the experiences in developing the plug-in, for the benefit of those who might also be interested in Eclipse plug-in development. Stay tuned!
[Update (12/05/2007) - Ack.. I forgot to set the compiler level to 1.5. As a consequence, v0.0.1 will not run on 5.0 JREs. It's fixed now in v0.0.2]
8 comments:
outstanding! Thanks for sharing.
nice work! I have been searching this for a few days.
Please get it done NOW
Thanks for taking on this project. You have no idea how popular you will be once you get this done!
Thanks a lot!
nice plugin, thanks!
This sounds very promising. I always wanted vi/vim keybinding on eclipse. I know they have it on Netbeans.
My question:
Does it work with the latest Eclipse IDE? I have Galileo and when I click on control 4, nothing happened.
These all comments are very sharing and good.This is one of the pretty collection.Keep it up.
Android app developers
Post a Comment