summary refs log tree commit diff
path: root/emacs.d/modules/module-java.el
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2018-04-08 16:13:12 -0700
committerFranck Cuny <franck.cuny@gmail.com>2018-04-08 16:13:12 -0700
commit4007ca81e0105119c8ed754e654a731934f5154c (patch)
tree41ba9d60f64866c8a098e631e8e32bf4249931fa /emacs.d/modules/module-java.el
parent[emacs] fix some path after directories reorg (diff)
downloademacs.d-4007ca81e0105119c8ed754e654a731934f5154c.tar.gz
[emacs] Large refactoring.
At first I wanted to add support for java, and then I realized that
maintaining a giant file with all the packages was not working as I
was expected.

The configuration is broken down to multiple files now, with each
major mode in a separate file, and the main modules in their own too.

This should make it easier to maintain and organize.
Diffstat (limited to '')
-rw-r--r--emacs.d/modules/module-java.el69
1 files changed, 69 insertions, 0 deletions
diff --git a/emacs.d/modules/module-java.el b/emacs.d/modules/module-java.el
new file mode 100644
index 0000000..33351fb
--- /dev/null
+++ b/emacs.d/modules/module-java.el
@@ -0,0 +1,69 @@
+(require 'config-package)
+
+(use-package autodisass-java-bytecode)
+
+(use-package meghanada
+  :defer t
+
+  :commands meghanada-mode
+
+  :init
+  (add-hook 'java-mode-hook
+            (lambda()
+              (google-set-c-style)
+              (google-make-newline-indent)
+              (meghanada-mode t)
+              (smartparens-mode t)
+              (rainbow-delimiters-mode t)
+              (highlight-symbol-mode t)))
+
+  :config
+  (setq meghanada-server-remote-debug t
+        meghanada-use-company t
+	meghanada-use-flycheck t
+	meghanada-auto-start t
+        meghanada-server-install-dir (expand-file-name "var/meghanada" user-emacs-directory))
+  (meghanada-install-server)
+
+  :bind
+  (:map meghanada-mode-map
+        ("C-S-t" . meghanada-switch-testcase)
+        ("M-r" . meghanada-reference)
+        ("M-t" . meghanada-typeinfo)
+        ("C-z" . hydra-meghanada/body)))
+
+(defhydra hydra-meghanada (:hint nil :exit t)
+"
+^Edit^                           ^Tast or Task^
+^----^---------------------------^------------^
+_f_: meghanada-compile-file      _m_: meghanada-restart
+_c_: meghanada-compile-project   _t_: meghanada-run-task
+_o_: meghanada-optimize-import   _j_: meghanada-run-junit-test-case
+_s_: meghanada-switch-test-case  _J_: meghanada-run-junit-class
+_v_: meghanada-local-variable    _R_: meghanada-run-junit-recent
+_i_: meghanada-import-all        _r_: meghanada-reference
+_g_: magit-status                _T_: meghanada-typeinfo
+_q_: exit
+"
+  ("f" meghanada-compile-file)
+  ("m" meghanada-restart)
+
+  ("c" meghanada-compile-project)
+  ("o" meghanada-optimize-import)
+  ("s" meghanada-switch-testcase)
+  ("v" meghanada-local-variable)
+  ("i" meghanada-import-all)
+
+  ("g" magit-status)
+
+  ("t" meghanada-run-task)
+  ("T" meghanada-typeinfo)
+  ("j" meghanada-run-junit-test-case)
+  ("J" meghanada-run-junit-class)
+  ("R" meghanada-run-junit-recent)
+  ("r" meghanada-reference)
+
+  ("q" exit)
+  ("z" nil "leave"))
+
+(provide 'module-java)