Loading ...
Sorry, an error occurred while loading the content.

Java development using VIM

Expand Messages
  • David Fishburn
    Vim 6.1.146 W2K I just recently switched to VIM from VI. I have been slowing building up my plugins, and appreciate all the help I have received on this
    Message 1 of 4 , Aug 14 7:00 PM
    • 0 Attachment
      Vim 6.1.146 W2K

      I just recently switched to VIM from VI.
      I have been slowing building up my plugins, and appreciate all the help
      I have received on this mailing list.

      I had a question about Java development.
      On a previous project, I had to switch to a different editor (from VI)
      to something that had much better Java support.

      Here are the types of things I would like for Java development

      1. Class method completion
      String dave;
      dave. <at this point bring up a list of all methods available for the
      String type, as well as the parent class, ....>
      I should be able to choose which method I want (and optionally display
      the prototype of the method).

      I believe EMACS is adding this (or has just finished adding it, even
      though it is a command line editor). If gVIM did this, I would be happy
      to use it, instead of the console version.


      2. Classpath support
      Based on a project, declare a custom classpath

      I see we can use the some of VIM features to give the appearance of a
      project:
      :h mkview
      :h mksession
      :h mkexrc

      But I don't really see anything that allows to me define a custom
      classpath for compiling and running (besides ANT support).



      3. Running and Debugging
      I have noticed that the list of compilers lacks Java. It does include
      jikes and ant. I am an ANT user, so this isn't much of an issue. But
      for very simple (for example 1 method test classes) java programs it
      would be nice to compile, run and debug from VIM. I have noticed a
      JavaRun.vim plugin. It can work for this simple case.

      Java 1.4 made quite a few improvements on the debugger, which I noticed
      the other editor I am using has incorportated.



      Out of the above, 1 is the most crucial. The time that this feature
      saves is enormous, especially for custom classes. I did find a very
      good editor that does this pretty well, but I hated switching from VI to
      learn a new editor.

      Does anyone have any solutions for the above?

      Is VIM development working on any of these items?

      TIA,
      Dave
    • Carfield Yim
      ... I find that there is a problem of mapping or to . The problem is when I press and reach the end of choice. vim will assume the last
      Message 2 of 4 , Aug 14 9:48 PM
      • 0 Attachment
        > > 1. Class method completion
        >
        > There are some plugins that provide a list of functions from tag files,
        > but that is not the same thing. As far as supplying a list of methods
        > for a given class, that is the realm of an IDE. Vim does have keyword
        > completion, which will allow you to complete words you have already
        > typed. For that try <c-n> and <c-p>. I have that mapped to <tab>.
        >
        I find that there is a problem of mapping <c-n> or <c-p> to <tab>. The
        problem is when I press <tab> and reach the end of choice. vim will
        assume the last choice as the selection and leave a <space> after that
        choice. In contrast, using <c-n> or <c-p> will cycle throught all the
        choices, it think this is better.

        Besides, I think that it will be better for the autocomplete behave
        exactly like shell, i.e.: when I press <tab> it will show all possible
        choice at the button of vim console / gvim windows.
      • Michael Brailsford
        ... There are some plugins that provide a list of functions from tag files, but that is not the same thing. As far as supplying a list of methods for a given
        Message 3 of 4 , Aug 14 10:25 PM
        • 0 Attachment
          > 1. Class method completion

          There are some plugins that provide a list of functions from tag files,
          but that is not the same thing. As far as supplying a list of methods
          for a given class, that is the realm of an IDE. Vim does have keyword
          completion, which will allow you to complete words you have already
          typed. For that try <c-n> and <c-p>. I have that mapped to <tab>.

          > 2. Classpath support

          I am not sure what you mean. Just use ant. You could easily create
          some macros that manipulated the build file for you.

          > 3. Running and Debugging

          Again this is the realm of an IDE, and debuggers. DDD is an excellent
          debugger, and it will debug Java code.

          > Is VIM development working on any of these items?

          AFAIK, no on all three counts. Vim is an editor, the features you
          describe belong in an IDE. I used to use JBuilder all the time, then I
          moved to Vim, and I found that I was able to work much more efficiently.

          -Michael
        • Benji Fisher
          ... This has been asked for many times. Dr. C has something similar for C and C++ at http://users.erols.com/astronaut/vim/#Cfunc It would be a service to the
          Message 4 of 4 , Aug 16 8:17 AM
          • 0 Attachment
            David Fishburn wrote:
            >
            > Vim 6.1.146 W2K
            >
            > I just recently switched to VIM from VI.
            > I have been slowing building up my plugins, and appreciate all the help
            > I have received on this mailing list.
            >
            > I had a question about Java development.
            > On a previous project, I had to switch to a different editor (from VI)
            > to something that had much better Java support.
            >
            > Here are the types of things I would like for Java development
            >
            > 1. Class method completion
            > String dave;
            > dave. <at this point bring up a list of all methods available for the
            > String type, as well as the parent class, ....>
            > I should be able to choose which method I want (and optionally display
            > the prototype of the method).
            >
            > I believe EMACS is adding this (or has just finished adding it, even
            > though it is a command line editor). If gVIM did this, I would be happy
            > to use it, instead of the console version.

            This has been asked for many times. Dr. C has something similar for C and
            C++ at
            http://users.erols.com/astronaut/vim/#Cfunc
            It would be a service to the vim community if someone could adapt this to Java,
            but no one has yet done so AFAIK.

            > 2. Classpath support
            > Based on a project, declare a custom classpath
            >
            > I see we can use the some of VIM features to give the appearance of a
            > project:
            > :h mkview
            > :h mksession
            > :h mkexrc
            >
            > But I don't really see anything that allows to me define a custom
            > classpath for compiling and running (besides ANT support).

            I am not sure what you want done here. You can set environment variables
            and make buffer-local variables. You can even define a script-local variable in
            your ftplugin/java.vim file.

            :help internal-variables

            > 3. Running and Debugging
            > I have noticed that the list of compilers lacks Java. It does include
            > jikes and ant. I am an ANT user, so this isn't much of an issue. But
            > for very simple (for example 1 method test classes) java programs it
            > would be nice to compile, run and debug from VIM. I have noticed a
            > JavaRun.vim plugin. It can work for this simple case.

            Then it should be simple to write a compiler/java.vim plugin, and post it
            on VimOnline.

            HTH --Benji Fisher
          Your message has been successfully submitted and would be delivered to recipients shortly.