forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-eclim.el
92 lines (75 loc) · 2.96 KB
/
init-eclim.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
;;; init-eclim.el --- Summary
;;; Commentary:
;;; init eclim
;;; Code:
(require-package 'eclim)
(require-package 'smartscan)
(require-package 'ggtags)
(require-package 'idle-highlight-mode)
(require-package 'auto-complete)
(require-package 'ac-emacs-eclim)
(require-package 'company-emacs-eclim)
(require 'eclim)
(require 'eclimd )
(global-eclim-mode)
(setq eclim-auto-save t ;; You *need* to have this one
eclim-executable "~/tools/eclipse/eclim" ;; Where the eclim installation is in
eclimd-default-workspace "~/workspace/.eclim" ;; Eclipse workspace
eclim-use-yasnippet nil
eclimd-wait-for-process nil
eclim-autoupdate-problems nil
help-at-pt-display-when-idle t
help-at-pt-timer-delay 0.5)
(help-at-pt-set-timer)
;; regular auto-complete initialization
(require 'auto-complete-config)
(ac-config-default)
;; Add the emacs-eclim source
(require 'ac-emacs-eclim)
(ac-emacs-eclim-config)
(require 'company)
(require 'company-emacs-eclim)
(company-emacs-eclim-setup)
(global-company-mode t)
(define-key global-map "\C-ce" 'start-eclimd)
(defun my-java-mode-hook ()
(auto-fill-mode)
(ggtags-mode)
;; (flyspell-prog-mode) ;; grabs C-; :(
;; (flymake-mode)
(eclim-mode)
(subword-mode)
(yas-minor-mode)
(smartscan-mode)
(idle-highlight-mode)
;; Only include eclim candidates in the completion menu, must be run
;; after eclim-mode above.
;; (setq ac-sources '(ac-source-emacs-eclim))
(define-key c-mode-base-map (kbd "C-S-o") 'eclim-java-import-organize)
(define-key c-mode-base-map (kbd "C-S-e") 'eclim-problems-show-errors)
(define-key c-mode-base-map (kbd "C-S-w") 'eclim-problems-show-warnings)
(define-key c-mode-base-map (kbd "C-m") 'c-context-line-break)
(define-key c-mode-base-map (kbd "C-q") 'eclim-java-show-documentation-for-current-element)
(define-key c-mode-base-map (kbd "M-RET") 'eclim-problems-correct)
(define-key c-mode-base-map (kbd "M-m") 'eclim-java-find-references)
(define-key c-mode-base-map (kbd "M-i") 'eclim-java-implement) ;; IDEA is C-i
(define-key c-mode-base-map (kbd "M-e") 'eclim-problems)
(define-key c-mode-base-map (kbd "M-.") 'eclim-java-find-declaration)
(define-key c-mode-base-map (kbd "S-M-r") 'eclim-java-refactor-rename-symbol-at-point)
(define-key c-mode-base-map (kbd "S-<f7>") 'gtags-find-tag-from-here)
(define-key c-mode-base-map (kbd "<f7>") 'gud-step)
(define-key c-mode-base-map (kbd "<f8>") 'gud-next)
(define-key c-mode-base-map (kbd "<f9>") 'gud-cont)
;; Fix indentation for anonymous classes
(c-set-offset 'substatement-open 0)
(if (assoc 'inexpr-class c-offsets-alist)
(c-set-offset 'inexpr-class 0))
;; Indent arguments on the next line as indented body.
(c-set-offset 'arglist-intro '+))
(add-hook 'java-mode-hook 'my-java-mode-hook)
(defun my-java-before-save-hook()
(when (eq major-mode 'java-mode)
(eclim-problems-show-errors)))
(add-hook 'before-save-hook 'my-java-before-save-hook)
(provide 'init-eclim)
;;; init-eclim.el ends here