Download or build
And edit your $HOME/.emacs
or $HOME/.emacs.d/init.el
.
(add-hook 'd-mode-hook 'eglot-ensure)
(add-to-list 'eglot-server-programs `(d-mode . ("/path/to/your/serve-d")))
OPTIONAL: If you want to customize serve-d (e.g. specifying paths), add
(setq-default eglot-workspace-configuration
'((:d . (:stdlibPath ("/path/to/dmd-2.098.0/src/phobos"
"/path/to/dmd-2.098.0/src/druntime/src")))))
For per-project config, add .dir-locals.el in your project root.