roxma / ncm-phpactor

USE https://github.com/phpactor/ncm2-phpactor FOR NCM2!
13 stars 3 forks source link

NCM2 compatibility #9

Closed weirdan closed 6 years ago

weirdan commented 6 years ago

Now that's NCM is deprecated, is there a way to use phpactor as completion source in NCM2? Are NCM source plugins compatible with NCM2?

roxma commented 6 years ago

For some reason I'm not working with PHP for a long time.

I could port this source for ncm2.

But maintainer is needed.

weirdan commented 6 years ago

So there's some porting required then. I've seen @dantleech had a fork of this plugin for ncm1, maybe he'd be willing to support ncm2 as well.

dantleech commented 6 years ago

I'm happy to maintain - Phpactor should also be supporting LSP soon, which is another way we can integrate.

roxma commented 6 years ago

https://github.com/roxma/ncm2-phpactor. The repo should be transfered to @dantleech

My test vimrc

set nocompatible
syntax on
filetype plugin indent on
set encoding=utf-8 fileencodings=ucs-bom,utf-8,gbk,gb18030,latin1 termencoding=utf-8

execute 'source ' . $WORKSPACE_DIR . '/plug.vim'

call plug#begin($WORKSPACE_DIR)

    Plug 'ncm2/ncm2'
    Plug 'roxma/nvim-yarp'
    autocmd BufEnter * call ncm2#enable_for_buffer()

    set completeopt=noinsert,menuone,noselect
    set shortmess+=c

    inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
    inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

    " snippet support
    Plug 'ncm2/ncm2-snipmate'
    Plug 'tomtom/tlib_vim'
    Plug 'marcweber/vim-addon-mw-utils'
    Plug 'garbas/vim-snipmate'
    inoremap <silent> <expr> <CR> ncm2_snipmate#expand_or("\<CR>", 'n')
    inoremap <expr> <c-u> ncm2_snipmate#expand_or("\<Plug>snipMateTrigger", "m")
    let g:snips_no_mappings = 1
    vmap <c-j> <Plug>snipMateNextOrTrigger
    vmap <c-k> <Plug>snipMateBack
    imap <expr> <c-k> pumvisible() ? "\<c-y>\<Plug>snipMateBack" : "\<Plug>snipMateBack"
    imap <expr> <c-j> pumvisible() ? "\<c-y>\<Plug>snipMateNextOrTrigger" : "\<Plug>snipMateNextOrTrigger"

    " phpactor support
    Plug 'roxma/ncm2-phpactor'
    Plug 'phpactor/phpactor'
    Plug 'ncm2/ncm2-bufword'

call plug#end()
dantleech commented 6 years ago

Thanks @roxma ! I've retransferred to phpactor/ncm2-phpactor.