How to configure dlang complete in vim?

Laurent Tréguier laurent.treguier.sink at gmail.com
Tue Oct 15 20:26:24 UTC 2019


On Tuesday, 15 October 2019 at 11:41:47 UTC, lili wrote:
> Hi:
>    Is there anybody use vim, can you shared your vim config.

Hi!

You can use a Language Server plugin [1] with a D Language Server 
[2] to get D support in Vim.
If you haven't heard of the Language Server Protocol (LSP), in a 
nutshell: it's a specification implemented by some editors (or 
editor plugins), and external programs (the "servers"). Editors 
use the servers to do linting, formatting, completion, etc. Any 
editor (or LSP plugin) can be used with any server (in theory).

To get started, you can intall one of the Vim LSP plugins (maybe 
you already have one of the popular ones such as COC [3] or ALE 
[4]).
Then, install a D language server; there are 2 available: Serve-D 
[5] (maintained by WebFreak) and DLS [6] (that I maintain).
The Vim plugin you choose to use should have a README explaining 
how to connect them to a language server.

I've only tested DLS with LanguageClient-neovim [7], but using 
any other plugins and Serve-D instead of DLS should work just as 
well.

[1] 
https://microsoft.github.io/language-server-protocol/implementors/tools
[2] 
https://microsoft.github.io/language-server-protocol/implementors/servers
[3] https://github.com/neoclide/coc.nvim
[4] https://github.com/dense-analysis/ale
[5] https://github.com/Pure-D/serve-d
[6] https://github.com/d-language-server/dls
[7] https://github.com/autozimu/LanguageClient-neovim


More information about the Digitalmars-d-ide mailing list