ncm2 / ncm2-d

:sparkles: ncm2 autocompletion source for D
Apache License 2.0
11 stars 1 forks source link
autocompletion dlang ncm2 ncm2-source neovim vim

ncm2-d

neovim/vim ncm2 autocompletion source for D.

screenshot

Install D

This plugin relies on D tools like dcd-server, dcd-client and dub to provide autocompletion. Make sure you have them available in your PATH.

Plugin Install

If you're using dein:

call dein#add('ncm2/ncm2')
call dein#add('ncm2/ncm2-d', {'on_ft': 'd'})
call dein#add('roxma/nvim-yarp')

" enable ncm2 for all buffers and set completeopt
autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=noinsert,menuone

If you're using vim-plug:

Plug 'ncm2/ncm2'
Plug 'ncm2/ncm2-d', { 'for': 'd' }
Plug 'roxma/nvim-yarp'

" enable ncm2 for all buffers and set completeopt
autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=noinsert,menuone

Settings

This plugin just works without any extra settings (packages installed with dub are already included path when starting dcd-server). If needed, you can adjust these variables:

let g:ncm2_d#dcd_client_bin = 'dcd-client'
let g:ncm2_d#dcd_client_args = ['']
let g:ncm2_d#dcd_server_bin = 'dcd-server'
let g:ncm2_d#dcd_server_args = ['-I/usr/include/dlang/dmd']
let g:ncm2_d#dcd_autostart_server = 1