From 337efaa30362858eab2437faa77f97027abca00a Mon Sep 17 00:00:00 2001 From: tsukimizake Date: Wed, 25 Jun 2014 19:13:57 +0900 Subject: [PATCH] Update README.md --- editors/emacs/README.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/editors/emacs/README.md b/editors/emacs/README.md index 44df6d9..1b1e60f 100644 --- a/editors/emacs/README.md +++ b/editors/emacs/README.md @@ -1,31 +1,40 @@ #Emacs Integration ##Requirements -* You must have the [auto-complete](https://github.com/auto-complete/auto-complete) package, and [yasnippet](https://github.com/capitaomorte/yasnippet) package is recommended. +* You must have the [auto-complete](https://github.com/auto-complete/auto-complete) package. +And [yasnippet](https://github.com/capitaomorte/yasnippet) package is recommended. * Make sure dcd-client and dcd-server is in your exec-path. Otherwise, please set the variable ```dcd-exectutable``` and ```dcd-server-executable``` using ```M-x customize```. ## Setup * First, follow the Setup section in the root README. * Second, add the following to your .emacs. With this setting, dcd-server starts automatically when you open file in d-mode. + ``` ;;; ac-dcd (add-to-list 'load-path "path_to_ac-dcd.el") (require 'ac-dcd) (add-to-list 'ac-modes 'd-mode) -(defun ac-d-mode-setup () - (ac-dcd-maybe-start-server) - (add-to-list 'ac-sources 'ac-source-dcd) - (auto-complete-mode t)) -(add-hook 'd-mode-hook 'ac-d-mode-setup) -(define-key d-mode-map (kbd "C-c C-h") 'ac-dcd-popup-ddoc-at-point) ;of course, you can change this keybind. +(add-hook 'd-mode-hook + '(lambda () "set up ac-dcd" + (ac-dcd-maybe-start-server) + (add-to-list 'ac-sources 'ac-source-dcd))) +(define-key d-mode-map (kbd "C-c ?") 'ac-dcd-popup-ddoc-at-point) +(define-key d-mode-map (kbd "C-c .") 'ac-dcd-goto-definition) +(define-key d-mode-map (kbd "C-c ,") 'ac-dcd-goto-def-pop-marker) ``` * Third, set import path using ```M-x customize-variable RET ac-dcd-flags```. * When something is wrong, please check variables with ```M-x customize-apropos RET ac-dcd``` and restart server with ```M-x ac-dcd-init-server```. +## Features +* Dlang source for auto-complete +* Function calltip expansion with yasnippet +* Show ddoc with ```C-c ?``` +* Goto definition with ```C-c .``` +* After goto definition, you can pop to previous position with ```C-c ,``` + ## TODO -* goto definition +* Better error handling * Multi byte character support (Need help!) -* and so on...