Add auto-insert setting for Java
This commit is contained in:
parent
63ed432ebb
commit
e1ff5ceda5
1 changed files with 10 additions and 1 deletions
11
oni-java.el
11
oni-java.el
|
@ -4,7 +4,7 @@
|
|||
|
||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||
;; 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)
|
||||
|
|
Loading…
Reference in a new issue