LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   vim code completion problem (https://www.linuxquestions.org/questions/linux-software-2/vim-code-completion-problem-626507/)

shogun1234 03-07-2008 06:40 PM

vim code completion problem
 
I follow the instruction at http://www.vim.org/scripts/script.php?script_id=1785 to enable the code completion, but fail. Following is the steps I perform. What do I miss?

1.) unzip javacomplete.zip to $HOME/.vim folder.
So under the .vim folder there contains 2 sub-folders, including autoload and doc

2.) update .vim doc
After launching the vim editor, typing `:helptags $HOME/.vim/doc`

3.) set Omnifunc.
In the .vimrc adding line 'setlocal omnifunc=javacomplete#Complete'

4.) compiling Reflection.java and put it under .vim/autoload and/ or $HOME/ folder.

5.) launching vim and in the insert mode, press button <Ctrl> + X / <Ctrl> + O , etc. But it does not work.

Where did I do it wrong? Or what steps I miss?

env: Debian lenny, vim v7.1.241, javacomplete.zip v0.77.1

Thank you very much

JMJ_coder 03-08-2008 07:36 PM

Hello,

What is <CTRL>+X and <CTRL>+O supposed to do?

If you enter a piece of code that they use as an example:

Code:

package com.foo

import java.util.;

public class Test extends java.net.SocketImpl {
    private String name;
    private String title;
   
    void title() {
        String.class
    }
}

with the cursor immediately after the last s in String.class, does a menu come up like it does in this example picture? http://blog.chinaunix.net/photo/44758_070917101048.jpg

The instructions say that Reflection.java will be automatically compiled and placed in your $HOME directory, so you shouldn't have to do anything with that.

Also, did you leave off the single quotes in the .vimrc?
The entry should be
Code:

setlocal omnifunc=javacomplete#Complete
And I might try if that doesn't work to put:

Code:

set omnifunc=javacomplete#Complete
in your .vimrc instead of the setlocal line.


All times are GMT -5. The time now is 09:18 PM.