Closed fcojavierdomenech closed 5 years ago
How can I set up ncm2 in order to trigger automatically the phpactor suggestions instead of the default ones?
Remove this plugin.
Read the css example in ncm2 README. You might also need :help ncm2#register_source
.
From the screen shot, this plugin is returning the phpactor suggestions. The omni-complete suggestions are the same? ncm2 does not, by default, complete PHP.
From the screen shot, this plugin is returning the phpactor suggestions. The omni-complete suggestions are the same? ncm2 does not, by default, complete PHP.
The first image is what I think omni-complete, second (pressing \<C-x>\<C-o>) phpactor. The look different despite both are perfectly valid
Yep that's expected. One is using native VIM omni-complete, the other ncm2 (both are using Phactor underneath)
How can I set up ncm2 in order to trigger automatically the phpactor suggestions instead of the default ones?
Remove this plugin.
Read the css example in ncm2 README. You might also need
:help ncm2#register_source
.
I removed 'phpactor/ncm2-phpactor', then in my vimrc:
autocmd FileType php setlocal omnifunc=phpactor#Complete
au User Ncm2Plugin call ncm2#register_source({
\ 'name' : 'php',
\ 'priority': 9,
\ 'subscope_enable': 1,
\ 'scope': ['php'],
\ 'mark': 'php',
\ 'word_pattern': '[\w\-]+',
\ 'complete_pattern': ['->'],
\ 'on_complete': ['phpactor#Complete'],
\ })
And after "$this->" I can see that automatically it's being called, but there is some kind of error:
[ncm2_core@yarp] php on_complete: Vim(call):E119: Not enough arguments for function: phpactor#Complete
Still working well when called through \<C-x>\<C-o>
Just out of interest, what advantage are you trying to gain here?
mmm I like your plugin and I'm aware you are actively working on it so I'd like to adapt my vim settings as much as possible to it. I saw the completions look different when triggered automatically and manually and I asked here.
With "your plugin" I mean Phpactor of course.
And after "$this->" I can see that automatically it's being called, but there is some kind of error:
It is important to keep the ncm2#on_complete#omni
in the on_complete
field.
Yep that's expected. One is using native VIM omni-complete, the other ncm2 (both are using Phactor underneath)
Ok, got it; Both are using phpactor but they represent the list in different ways. Thanks
I know this is more a missconfiguration than an issue, and I've been looking but I don't know how to fix it. By default I'm getting what I think is the default ncm2 autocompletion (triggered automatically): Then, if I press \<C-x>\<C-o> I get the phpactor source: How can I set up ncm2 in order to trigger automatically the phpactor suggestions instead of the default ones?