Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » launching vim from eclipse
launching vim from eclipse [message #211506] Mon, 21 May 2007 16:30 Go to next message
Eclipse UserFriend
Originally posted by: gmguyx.gmail.com

I would like to open a currently displayed Eclipse file in an external
application (gvim) and jump to the current line number of that file.

ie: "gvim -c:<line_number> <file_name>".

I have 2 questions regarding this:

1. I see from the Eclipse api that I can get the filename from
org.eclipse.core.filebuffers.FileBuffers. However, I don't see any way of
getting the line number of the currently displayed file. Is there a way to
do this?

2. It seems like a lot of trouble to have to create a plug-in to do such a
simple thing. Is there any way to have Eclipse call some external
shell/.bat script? That would be a lot simpler.

Thank you.
Re: launching vim from eclipse [message #211544 is a reply to message #211506] Mon, 21 May 2007 22:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------010307090703030003040302
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

YM,

If you like vi and can't live without it like me, I would highly
recommend the vi plugin. It's really cool in that you can use vi
without losing all the great function provided by Eclipse:

http://www.satokar.com/viplugin/

Unfortunately I don't think there's an easy way to do what you want in a
general way...


YM wrote:
> I would like to open a currently displayed Eclipse file in an external
> application (gvim) and jump to the current line number of that file.
>
> ie: "gvim -c:<line_number> <file_name>".
>
> I have 2 questions regarding this:
>
> 1. I see from the Eclipse api that I can get the filename from
> org.eclipse.core.filebuffers.FileBuffers. However, I don't see any way
> of getting the line number of the currently displayed file. Is there a
> way to do this?
>
> 2. It seems like a lot of trouble to have to create a plug-in to do
> such a simple thing. Is there any way to have Eclipse call some
> external shell/.bat script? That would be a lot simpler.
>
> Thank you.
>
>
>


--------------010307090703030003040302
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
YM,<br>
<br>
If you like vi and can't live without it like me, I would highly
recommend the vi plugin.
Re: launching vim from eclipse [message #211551 is a reply to message #211544] Mon, 21 May 2007 23:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gmguyx.gmail.com

Hi Ed,

Thanks for the tip. I just downloaded the viplugin and it's pretty cool.
Unfortunately it still doesn't quite do what I want because I have all
sorts of customizations in my _vimrc file and also gvim has lots of
features not implemented in the viplugin. However, as you said, there
doesn't seem to be an easy way to do this (especially since I'm an eclipse
newbie and never written a plugin before) so I'll just try out the
viplugin for now and see if I can live with that.

It's kind of ironic because when I was using MS Visual Studio before, I
was looking for something with the viplugin functionality but the only
thing I could find was Visvim which launches gvim externally. I didn't
like this at first, but then it grew on me and now that the viplugin which
I was originally looking for with MS VS is available in Eclipse, I'm no
longer interested in it and would rather have something like the Visvim
model of launching gvim externally! :-)

Thanks again,
YM
Re: launching vim from eclipse [message #211618 is a reply to message #211551] Tue, 22 May 2007 13:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

YM wrote:
> Hi Ed,
>
> Thanks for the tip. I just downloaded the viplugin and it's pretty cool.
> Unfortunately it still doesn't quite do what I want because I have all
> sorts of customizations in my _vimrc file and also gvim has lots of
> features not implemented in the viplugin. However, as you said, there
> doesn't seem to be an easy way to do this (especially since I'm an
> eclipse newbie and never written a plugin before) so I'll just try out
> the viplugin for now and see if I can live with that.
>
> It's kind of ironic because when I was using MS Visual Studio before, I
> was looking for something with the viplugin functionality but the only
> thing I could find was Visvim which launches gvim externally. I didn't
> like this at first, but then it grew on me and now that the viplugin
> which I was originally looking for with MS VS is available in Eclipse,
> I'm no longer interested in it and would rather have something like the
> Visvim model of launching gvim externally! :-)

Why don't you list the things that vim does that the Eclipse editor does
not, in an effort to improve the tool for everyone. It may turn out that
the features you like in vim are already in Eclipse, and if not then
feature requests are always welcome and often implemented.

Eric
Re: launching vim from eclipse [message #211684 is a reply to message #211618] Wed, 23 May 2007 04:20 Go to previous message
Eclipse UserFriend
Originally posted by: gmguyx.gmail.com

> Eric Rizzo wrote:
> Why don't you list the things that vim does that the Eclipse editor does
> not, in an effort to improve the tool for everyone. It may turn out that
> the features you like in vim are already in Eclipse, and if not then
> feature requests are always welcome and often implemented.

I like having a separate command mode which allows me to edit my code
without having to use <ctrl>, <shift>, etc. But a lot of non-vi users
don't like having a separate editing mode. The viPlugin which Ed mentioned
seems to take this about as far as it can go in Eclipse. But no vi plugin
will ever have all the features that vim has.

Come to think of it, I think what I would want most from Eclipse is to
provide an easier way to customize Eclipse. I think Eclipse plug-ins are
very useful and powerful. However, perhaps Eclipse could also provide an
alternate simpler way of customizing Eclipse for tasks which do not
require the power of plug-ins. Like in the vim _vimrc file you can just
write simple scripts of just a few lines in length.
Previous Topic:eclipse from wtp-all-in-one-sdk-R-1.5.4-linux-gtk.tar.gz
Next Topic:plugin testing - test Eclipse instance
Goto Forum:
  


Current Time: Sat May 11 08:14:20 GMT 2024

Powered by FUDForum. Page generated in 0.08816 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top