Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I do php function omni complete #33

Closed
markwu opened this issue Jul 9, 2013 · 10 comments
Closed

How can I do php function omni complete #33

markwu opened this issue Jul 9, 2013 · 10 comments
Labels

Comments

@markwu
Copy link

markwu commented Jul 9, 2013

How can I do php function omni complete without hit <c-x><c-o>? I tried several settings, no luck :(

screenshot

@Shougo
Copy link
Owner

Shougo commented Jul 9, 2013

You can use PHP omni function in neocomplete.
But it is too slow.

        if !exists('g:neocomplete#sources#omni#input_patterns')
          let g:neocomplete#sources#omni#input_patterns = {}
        endif
        let g:neocomplete#sources#omni#input_patterns.php =
        \ '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'

@markwu
Copy link
Author

markwu commented Jul 9, 2013

I did the same settings. The completion works when I typed after -> and ::, but not works when I just type like "set_"..., I have to hit <c-x><c-o> to get the php completion.

@Shougo
Copy link
Owner

Shougo commented Jul 9, 2013

let g:neocomplete#sources#omni#input_patterns.php = '\h\w*\|[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'

If you set this settings, you can use full completion. But it is too heavy.
I don't recommend it.

@markwu
Copy link
Author

markwu commented Jul 9, 2013

Great thanks. I tried it, it works as I want. But, you said you don't recommend it, so, what is the best practice for my purpose? Using dictionary/keyword for native php function completion?

@Shougo
Copy link
Owner

Shougo commented Jul 9, 2013

PHP omni completion is too slow.
So,

  1. Create other completion for PHP
  2. Using dictionary completion

@markwu
Copy link
Author

markwu commented Jul 9, 2013

I tried https://github.com/shawncplus/phpcomplete.vim with neocomplete, the performance seems acceptable.

@Shougo
Copy link
Owner

Shougo commented Jul 10, 2013

OK. I will add it in the documentation.

@markwu
Copy link
Author

markwu commented Jul 10, 2013

Is that possible I set the omni pattern like this

let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'

This setting will pop up neocomplete after -> and ::

But, when I click, for example <ctrl-space>, it will pop up omni completion through neocomplete at any time. So, I can click <ctrl-space> after 'set_' to get omni complete for patterns like '\h\w*'

YouCompleteMe has this feature. If neocomplete can do the same, then we don't need to worry about the some heavy completions like php or ruby?

@Shougo
Copy link
Owner

Shougo commented Jul 10, 2013

inoremap <expr><C-Space>        neocomplete#start_manual_complete('omni')

Yes, you can.

@Shougo Shougo closed this as completed Jul 10, 2013
@markwu
Copy link
Author

markwu commented Jul 10, 2013

Wow ...amazing. I really like it. It just works like YouCompleteMe, and the performance is quite acceptable with https://github.com/shawncplus/phpcomplete.vim.

Great thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants