1
0
Fork 0

Add auto-insert setting for Java

This commit is contained in:
Tom Willemse 2019-07-23 22:53:51 -07:00
parent 63ed432ebb
commit e1ff5ceda5

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 20190710075522 ;; Version: 20190723225257
;; Package-Requires: (oni-fci oni-data-dir lsp-java company-lsp lsp-ui hydra) ;; Package-Requires: (oni-fci oni-data-dir lsp-java company-lsp lsp-ui hydra)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -26,6 +26,7 @@
;;; Code: ;;; Code:
(require 'autoinsert)
(require 'hydra) (require 'hydra)
(require 'lsp-java) (require 'lsp-java)
(require 'oni-data-dir) (require 'oni-data-dir)
@ -63,6 +64,14 @@
(define-key java-mode-map (kbd "C-c r") 'java-refactor-hydra/body) (define-key java-mode-map (kbd "C-c r") 'java-refactor-hydra/body)
(add-to-list 'auto-insert-alist
'("\\.java\\'"
() "public class "
(file-name-sans-extension
(file-name-nondirectory (buffer-file-name))) " {\n"
(indent-for-tab-command) _ "\n"
"}"))
;;;###autoload(with-eval-after-load 'cc-mode (require 'oni-java)) ;;;###autoload(with-eval-after-load 'cc-mode (require 'oni-java))
(provide 'oni-java) (provide 'oni-java)