Ⅰ. 插件描述
Coordinate D tools to work together for youⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'idanarye/dutyl'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'idanarye/dutyl'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'idanarye/dutyl'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/idanarye/vim-dutyl
Ⅳ. 文档说明
INTRODUCTION
Dutyl operates various Dlang tools to help you program D in Vim. Instead of
having a separate plugin for each tool, Dutyl can use multiple plugins and
use them together - for example, use DUB to get a list of import paths the
project is using and pass that list to DCD to get autocompleting for symbols
that come from libraries. Dutyl has a module(/plugin) system that allows tools
to back up each other - so for example if a project doesn't use DUB, Dutyl can
back up reading the import paths from a static configuration file.
Currently supported features:
- Getting the imports list from DUB or from a configuration file
- Autocompletion using DCD
- Finding DDoc using DCD
- Finding declarations using DCD or Dscanner
- Syntax and style checks using Dscanner
- Updating the tags file using Dscanner
- Recognizing the project's root and running commands there
- Formatting code using dfmt
- Indenting using dfmt
REQUIREMENTS
Dutyl requires the tools that it uses. If you want it to use DUB to get info
about the project, you need DUB. If you want
it to use DCD for autocompletion, you need
DCD(currently tested with version 0.4.0).
If you want it to use Dscanner, you need
Dscanner. If you want it to use
dfmt, you need dfmt.
NOTE ABOUT DCD
DCD functionality won't work without a dcd-server running. Dutyl does not rundcd-server automatically, but it does offer several commands to ease that
task:
:DUDCDstartServerto start DCD:DUDCDstopServerto stop DCD:DUDCDrestartServerto restart DCD:DUDCDclearCacheto clear the DCD cache
CONFIGURATION
Use g:dutyl_stdImportPaths to specify the standard library import paths.
let g:dutyl_stdImportPaths=['/usr/include/dlang/dmd']You must either set g:dutyl_stdImportPaths or configure these paths in DCD
itself, or else DCD won't be able to recognize standard library symbols.
If you want to never add the closing paren in calltips completions, setg:dutyl_neverAddClosingParen to 1:
let g:dutyl_neverAddClosingParen=1Dutyl will assume that tools are in the system's PATH. If they are not, you'll
have to supply the path for them using dutyl#register#tool like so:
call dutyl#register#tool('dcd-client','/path/to/DCD/dcd-client')
call dutyl#register#tool('dcd-server','/path/to/DCD/dcd-server')Note: If you are using a plugin manager(like Pathogen or Vundle), make sure
that you only call dutyl#register#tool after you run the plugin manager's
command for updating the runtime path(pathogen#infect in case of Pathogen,vundle#end in case of Vundle, or whatever the command is for whatever the
tool you are using).
Under Windows, Dutyl uses VimProc when
available to prevent opening a console windows every time a command needs to be
- To prevent using VimProc, set
g:dutyl_dontUseVimProcto 1:
let g:dutyl_dontUseVimProc=1Dutyl will use a local file named "tags" for tags. If you want to everride
this, set g:dutyl_tagsFileName to the name of the new tags file:
let g:dutyl_tagsFileName='newnamefortagsfile'Note that the new tags file name will still have to be in tags in order
for Vim to recognize it.
If dfmt is detected in your path(or if you set it's path viadutyl#register#tool), Dutyl will automatically set formatexpr andindentexpr when you enter a D file. To disable this, setg:dutyl_dontHandleFormat and/or g:dutyl_dontHandleIndent to 1:
let g:dutyl_dontHandleFormat = 1
let g:dutyl_dontHandleIndent = 1Contributing
Please see CONTRIBUTING.md.