Closed dnMarc closed 4 years ago
Hello. Sounds like complex setup. Why not you try to start with clean nvim or vim config file?
autocmd FileType java setlocal omnifunc=javacomplete#complete
complete
should be in CamelCase: javacomplete#Complete
You need something like YouCompleteMe or deoplete if you want completion to work automatically, and you do not need to press C-xC-o
every time.
Hi @artur-shaik,
Thank you very much for your response. Fixing the camel casing in javacomplete#Complete
enabled the functionality for me – my apologies for the simple error, I really appreciate you pointing this out for me. I am not familiar with YouCompleteMe or deoplete, but I will give those a try tomorrow.
Thank you again for your help, I really appreciate it.
Cheers,
Dan
Hi All, I want to start by apologizing for the newb level of this question. I am new to Vim and am very excited to get the javacomplete2 plugin working. I have attempted to get the plugin working by using a pre-configured Docker image (https://hub.docker.com/r/aghost7/nvim). Docker containers spun up from this image contain 3 vim configuration files: init.vim, post-plugin.vim and plugin.vim. I pasted the contents of these files below. I am able to get some of the plugin's features working, but not autocompletion based on valid java methods for given types, instead when I attempt to autocomplete (using Control + n) I simply get a list of words that have already appeared in the .java file I am editing. I see this issue is similar to issue #46. I attempted Control + x followed by Control + o, but I get the following error
I believe I added the required lines discussed in the Configuration directions on the landing page of this repo as you can see in my init.vim and plugin.vim. The long and short of it is that I am trying to get this plugin setup in a docker image so I can spin up containers from anywhere and have this editing environment available. I am by no means wedded to using this particular docker image, but given my lack of knowledge in this area I thought it was a good place to start.
I performed my trials by spinning up a docker container from the image linked above with:
docker run -it aghost7/nvim:latest /bin/bash
. Once in the container, I updated apt-get and used apt-get to installopenjdk-8-jdk
. After this I added the lines enclosed in the "DM added" quotes in init.vim. I then created a HelloWorld java file using nvim, and from within nvim I ranPlugUpdate
. After this I closed and re-opened nvim on this file and attempted autocompletion with Control+n with the undesired results discussed above. While I don't think it should impact any of this, in the interest of full transparency, I have done all of this inside a tmux session. I checked, and python 2.7.12 is installed (and is on the PATH) @ /usr/bin/python. I am able to see java compiler errors when editing .java files after adding the configuration entries in init.vim and plugin.vim and installing the javacomplete2 plugin, so it appears the plugin is able to communicate with the java compiler.I checked the version of both vim and nvim and get the following back
I also checked the Dockerfile for this Docker image, traced back through its inheritance, and it appears to be built on
ubuntu:xenial
.I would really appreciate any guidance folks are willing to provide to help me get this up and running.
Thank you all for your help and patience. Cheers, Dan
Pasted details are are below.
When I run env I get the following:
init.vim
plugin.vim
post-plugin.vim (I didn't modify this file at all)