Shougo / neocomplcache.vim

Ultimate auto-completion system for Vim.
http://www.vim.org/scripts/script.php?script_id=2620
1.72k stars 135 forks source link

Autocomplete paths relative to currently open file #490

Closed raine closed 10 years ago

raine commented 10 years ago

I used YouCompleteMe before, and it would autocomplete paths relative to the current file, meanwhile neocomplcache seems always autocomplete from pwd.

This makes autocomplete useless for scenarios like require('../foo/etc for any file that is not directly under pwd.

No one seems to have raised this issue before so I'm confused if I'm missing something obvious.

Thank you.

Shougo commented 10 years ago

OK. It seems good point. I may implement the feature in neocomplete. But I don't want to change neocomplcache feature. Sorry.

Shougo commented 10 years ago

In neocomplete, you can complete files from buffer directory in file_include source.

raine commented 10 years ago

I'll check neocomplete later, thanks!

raine commented 10 years ago

Hey Shougo, now using neocomplete.

In neocomplete, you can complete files from buffer directory in file_include source.

I don't quite understand how to get this working. Any pointers?

Shougo commented 10 years ago

For example, in C language:

#include "my|"

| is on the cursor. You can get my prefixed include files. It is current open file relative if the path option countains . character. I think it is better.