Enable ‘auto-fill-mode’ in Java
This commit is contained in:
parent
585e6b4e76
commit
d83e843404
1 changed files with 9 additions and 3 deletions
12
oni-java.el
12
oni-java.el
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||
;; 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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue