It sounds like you are just missing the filetype plugin support. In
vim, try running the following command:
:EclimValidate
That command will run some checks to ensure that your vim instance has
the minimum required settings. I have a feeling that it will prompt
you to add the following to your .vimrc:
filetype plugin indent on
If after adding that you still don't get any syntax highlighting, then
be sure to add the following to your .vimrc as well:
syntax on
Once you have the basic vim settings enabled, then you can start
taking advantage of eclim features (after creating a project[1] of
course).
Hopefully that gets you going, but if you have more questions, feel
free to ask.
[1] http://eclim.sourceforge.net/guides/java/project.html
--
eric
Have you created a java project yet? Eclipse/eclim requires a project
to be created before features like code completion, etc can be
provided. Take a look at the java project guide[1] which should get
you started.
> The only thing I do notice, is
> that when I write or save a VIM'ed file *now*, I get the following
> error notice (even on trivial tiny files):
>
> >> Error detected while processing function
> eclim#project#util#RefreshFileBootstrap..eclim#project#util
> >> #GetCurrentProjectName..eclim#project#util#GetProjects:
> >> line 64:
> >> E706: Variable type mismatch for: result
> >> line 65:
> >> E691: Can only compare List with List
> >> "Test" [New] 1L, 14C written
>
> Since my "Test.java" file had only one line in it (a few random
> ASCII characters in fact), I don't understand why lines 64 and 65 are
> even being referenced. (Note: "Test.java" was created in my home
> directory, not
> in my IDE workspace directory if that somehow makes a difference).
This is unfortunately a bug in eclim that you've encountered. The
line numbers referenced are from the eclim vim file that has the
error, not your java file. The particular issue was fixed with the
following changeset:
http://eclim.git.sourceforge.net/git/gitweb.cgi?p=eclim/eclim;a=commitdiff;h=edd210991530b63b243e00019cc2227c6cdf5bb9
Try manually applying those changes (renaming 'result' to 'results' in
that else block), which should resolve that error.
> In summary, not only am I not getting the "Eclipse experience" within
> VIM,
> but saving trivially small files (3 or 4 characters), now results in
> the
> error(s) above.
>
> Could use some more help. Perhaps I'm missing other settings within
> ~/.vimrc?
> (A complete sample would be appreciated).
Since :EclimValidate passed for you, then you must have the necessary
minimum setting enabled. Since your ~/.vimrc only has the one line,
my guess is that your OS is providing a default vimrc somewhere else,
like at /etc/vim/vimrc.
Overall it seems as though you have everything setup correctly. Once
you've patched that one file to fix that bug, and you've created a
java project, you should able to leverage eclim's features.
I would go ahead and move that file back. It's highly unlikely that
the vimrc in etc is hurting anything and since your local .vimrc is so
bare bones, not having the etc vimrc might just make things worse. For
instance, does :EclimValidate still give you a positive result when
/etc/vimrc is disabled?
> (3) I've manully (from the CLI) started eclimd as follows (Note: the
> Eclipse GUI is itself *never* running):
> user$ nohup /home/user/.eclipse/latest/configuration/eclipse/plugins/
> latest-eclim/bin/eclimd &
> [[ This succeeds. Pingable; Verifable; etc. from within VIM ]]
>
> (4) vi /home/user/Test.java (which is my home directory, not any of
> the Eclipse Projects Directories).
> vi /home/user/ECLIPSE.d/MyProject/src/Test.java (Which *is* an
> Eclipse project directory).
> =============================================================
>
> The above scenarios do not produce the desired result. Does that help
> you with clues? Appreciated.
What are your expected results? Can you describe what you are doing
in the java source file that is not behaving as you expect?
Looking back on your original mail, you mention expecting "colorful
interaction, with dynamic suggestions, etc. as I typed. But all I see
is plain old vim (with white letters on a black background)."
So first off, I don't think you've resolved the syntax highlighting
issue, something that should work independent of eclim. Perhaps using
'vi' instead of 'vim' is contributing to the lack of syntax
highlighting (on some distros, using 'vi' is not the same as using
'vim', even though both may share the same binary, the 'vi' version
sometimes runs vim with various features disabled).
As for "dynamic suggestions" I believe you are referring to code
completion? Note that all the code completion support that eclim
provides, is done so using the standard vim completion mechanisms[1].
So, unlike some IDEs you won't get a popup of suggestions as you type.
Instead you have to actually tell vim that you want suggestions (in
vim type ':help ins-completion' for more detail). In the case of
eclim provided code completion, the default key combination to
initiate the completion mode is 'ctrl-x ctrl-u', which is the default
vim key binding for 'user defined completion'. I personally find that
key binding cumbersome, so I use supertab[2] to make things easier.
[1] http://eclim.sourceforge.net/vim/code_completion.html
[2] http://www.vim.org/scripts/script.php?script_id=1643
--
eric