diff --git a/oni-java.el b/oni-java.el index 319b2a2..73a254a 100644 --- a/oni-java.el +++ b/oni-java.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 20190528071542 +;; Version: 20190611081136 ;; Package-Requires: (oni-fci oni-data-dir lsp-java company-lsp lsp-ui) ;; This program is free software; you can redistribute it and/or modify @@ -33,6 +33,10 @@ "Format the buffer before save." (add-hook 'before-save-hook 'lsp-format-buffer nil :local)) +(defun oni-java-only-fill-comments () + "Set `comment-auto-fill-only-comments' to true locally." + (setq-local comment-auto-fill-only-comments t)) + (setq lsp-java-server-install-dir (oni-data-dir-locate "lsp-java/server/")) @@ -42,11 +46,13 @@ (setq lsp-java-workspace-cache-dir (oni-data-dir-locate "lsp-java/workspace/cache/")) -(add-hook 'java-mode-hook 'electric-pair-local-mode) +(add-hook 'java-mode-hook #'oni-java-enable-buffer-formatting) +(add-hook 'java-mode-hook #'oni-java-only-fill-comments) +(add-hook 'java-mode-hook 'auto-fill-mode) (add-hook 'java-mode-hook 'electric-indent-local-mode) +(add-hook 'java-mode-hook 'electric-pair-local-mode) (add-hook 'java-mode-hook 'fci-mode) (add-hook 'java-mode-hook 'lsp) -(add-hook 'java-mode-hook 'oni-java-enable-buffer-formatting) (add-to-list 'company-backends 'company-lsp)