Added a Vim plugin option to add import paths as arguments to DCDstartServer

This commit is contained in:
IdanArye 2013-08-30 03:46:55 +03:00
parent 3dca325f6e
commit 066c1d6058
3 changed files with 12 additions and 7 deletions

View File

@ -24,13 +24,15 @@ Import paths are globbed with Vim's globbing function.
Usage
===================
When the filetype is D, use the `DCDstartServer` command to start the server
and the `DCDstopServer` command to stop the server.
and the `DCDstopServer` command to stop the server. `DCDstartServer` can
receive import path(s) as arguments.
Use the `DCDaddPath` command to add an import path to the server. Make sure you
Use the `DCDaddPath` command to add a import path(s) to the server. Make sure you
escape spaces! Import paths are globbed with Vim's globbing function.
Use the `DCD` command to send arbitary commands to the server via the client.
The syntax is the same as with `dcd-client`, so you can use it without
arguments to print the help message.
When the server is running, use `CTRL`+`x` `CTRL`+`o` to use DCD completion.
When the server is running, use `CTRL`+`x` `CTRL`+`o` in a D buffer to use DCD
completion.

View File

@ -73,9 +73,10 @@ endfunction
"DCD's syntax.
function! dcomplete#initImportPath()
if exists('g:dcd_importPath')
return dcomplete#globImportPath(g:dcd_importPath)
return dcomplete#globImportPath(copy(g:dcd_importPath))
else
return ''
endif
return ''
endfunction
"Run DCD to get autocompletion results

View File

@ -1,9 +1,11 @@
setlocal omnifunc=dcomplete#Complete
if has('win32')
command! -buffer DCDstartServer execute '!start '.dcomplete#DCDserver().' '.dcomplete#initImportPath()
command! -buffer -nargs=* -complete=dir DCDstartServer execute '!start '.dcomplete#DCDserver().' '.dcomplete#initImportPath().
\ ' '.dcomplete#globImportPath([<f-args>])
else
command! -buffer DCDstartServer execute '!'.dcomplete#DCDserver().' '.dcomplete#initImportPath().' > /dev/null &'
command! -buffer -nargs=* -complete=dir DCDstartServer execute '!'.dcomplete#DCDserver().' '.dcomplete#initImportPath().
\ ' '.dcomplete#globImportPath([<f-args>]).' > /dev/null &'
endif
command! -buffer -nargs=? DCD execute '!'.dcomplete#DCDclient().' '.<q-args>
command! -buffer DCDstopServer DCD --shutdown