Dutyl


Ⅰ. 插件描述

Coordinate D tools to work together for you

Ⅱ. 基本信息

创建日期:  2014-08-13
使用用户:  39
Github星:  77
插件作者:  Idan Arye

Ⅲ. 安装方法

使用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 run
dcd-server automatically, but it does offer several commands to ease that
task:

  • :DUDCDstartServer to start DCD
  • :DUDCDstopServer to stop DCD
  • :DUDCDrestartServer to restart DCD
  • :DUDCDclearCache to 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, set
g:dutyl_neverAddClosingParen to 1:

let g:dutyl_neverAddClosingParen=1

Dutyl 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

  1. To prevent using VimProc, set g:dutyl_dontUseVimProc to 1:
let g:dutyl_dontUseVimProc=1

Dutyl 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 via
dutyl#register#tool), Dutyl will automatically set formatexpr and
indentexpr when you enter a D file. To disable this, set
g:dutyl_dontHandleFormat and/or g:dutyl_dontHandleIndent to 1:

let g:dutyl_dontHandleFormat = 1
let g:dutyl_dontHandleIndent = 1

Contributing

Please see CONTRIBUTING.md.

添加新评论