diff --git a/oni-java.el b/oni-java.el index 7ad0e83..f680698 100644 --- a/oni-java.el +++ b/oni-java.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 20190710075522 +;; Version: 20190723225257 ;; 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 @@ -26,6 +26,7 @@ ;;; Code: +(require 'autoinsert) (require 'hydra) (require 'lsp-java) (require 'oni-data-dir) @@ -63,6 +64,14 @@ (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)) (provide 'oni-java)