2015-06-15 09:05:52 +02:00
|
|
|
;;; core-auto-insert.el --- file templates
|
|
|
|
|
|
|
|
(use-package autoinsert
|
2015-10-26 00:36:23 -04:00
|
|
|
:defer t
|
2015-06-15 09:05:52 +02:00
|
|
|
:init
|
|
|
|
(setq auto-insert-query nil) ; Don't prompt before insertion
|
|
|
|
(setq auto-insert-alist '())
|
|
|
|
:config
|
|
|
|
(auto-insert-mode 1)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "/\\.gitignore$" "__" 'gitignore-mode)
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
;; C/C++
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "/Makefile$" "__" 'makefile-gmake-mode)
|
|
|
|
(add-template! "/main\\.\\(cc\\|cpp\\)$" "__main.cpp" 'c++-mode)
|
|
|
|
(add-template! "/win32_\\.\\(cc\\|cpp\\)$" "__winmain.cpp" 'c++-mode)
|
|
|
|
(add-template! "\\.\\([Hh]\\|hpp\\)$" "__.h" 'c++-mode)
|
|
|
|
(add-template! "\\.\\(cc\\|cpp\\)$" "__.cpp" 'c++-mode)
|
|
|
|
(add-template! "\\.c$" "__.c" 'c-mode)
|
2015-06-15 09:05:52 +02:00
|
|
|
|
2015-09-30 13:52:02 -04:00
|
|
|
;; Elisp
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "\\.emacs\\.d/.+\\.el$" "__initfile" 'emacs-lisp-mode)
|
|
|
|
(add-template! "\\.emacs\\.d/private/\\(snippets\\|templates\\)/.+$" "__" 'snippet-mode)
|
2015-09-30 13:52:02 -04:00
|
|
|
|
|
|
|
;; Go
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "/main\\.go$" "__main.go" 'go-mode t)
|
|
|
|
(add-template! "\\.go$" "__.go" 'go-mode)
|
2015-09-30 13:52:02 -04:00
|
|
|
|
|
|
|
;; HTML
|
2015-11-07 00:18:21 -05:00
|
|
|
(add-template! "\\.html$" "__.html" 'web-mode)
|
2015-09-30 13:52:02 -04:00
|
|
|
|
2015-11-06 02:21:45 -05:00
|
|
|
;; java
|
|
|
|
(add-template! "/src/.+/.+\\.java$" "__" 'java-mode)
|
|
|
|
(add-template! "/main\\.java$" "__main" 'java-mode)
|
|
|
|
(add-template! "/build\\.gradle$" "__build.gradle" 'android-mode)
|
2015-09-30 13:52:02 -04:00
|
|
|
|
|
|
|
;; Javascript
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "\\.lbaction/.+/Info.plist$" "__Info.plst" 'lb6-mode)
|
|
|
|
(add-template! "\\.lbaction/.+/\\(default\\|suggestions\\)\\.js$" "__default.js" 'lb6-mode)
|
|
|
|
(add-template! "/package\\.json$" "__package.json" 'json-mode)
|
|
|
|
(add-template! "\\.\\(json\\|jshintrc\\)$" "__" 'json-mode)
|
2015-09-30 13:52:02 -04:00
|
|
|
|
|
|
|
;; Lua
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "/main\\.lua$" "__main.lua" 'love-mode)
|
|
|
|
(add-template! "/conf\\.lua$" "__conf.lua" 'love-mode)
|
2015-09-30 13:52:02 -04:00
|
|
|
|
|
|
|
;; Markdown
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "\\.md$" "__" 'markdown-mode)
|
|
|
|
(add-template! "/_posts/.+\\.md$" "__jekyll-post" 'markdown-mode)
|
|
|
|
(add-template! "/_layouts/.+\\.html$" "__jekyll-layout.html" 'web-mode)
|
2015-09-30 13:52:02 -04:00
|
|
|
|
|
|
|
;; PHP
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "\\.class\\.php$" "__.class.php" 'php-mode)
|
|
|
|
(add-template! "\\.php$" "__" 'php-mode)
|
2015-09-30 13:52:02 -04:00
|
|
|
|
|
|
|
;; Python
|
2015-11-06 02:21:45 -05:00
|
|
|
;; (add-template! "tests?/test_.+\\.py$" "__" 'nose-mode)
|
|
|
|
;; (add-template! "/setup\\.py$" "__setup.py" 'python-mode)
|
|
|
|
(add-template! "\\.py$" "__" 'python-mode)
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
;; Ruby
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "/\\.rspec$" "__.rspec" 'rspec-mode)
|
|
|
|
(add-template! "/spec_helper\\.rb$" "__helper" 'rspec-mode t)
|
|
|
|
(add-template! "_spec\\.rb$" "__" 'rspec-mode t)
|
|
|
|
(add-template! "/Rakefile$" "__Rakefile" 'enh-ruby-mode t)
|
|
|
|
(add-template! "/Gemfile$" "__Gemfile" 'enh-ruby-mode t)
|
|
|
|
(add-template! "\\.gemspec$" "__.gemspec" 'enh-ruby-mode t)
|
|
|
|
(add-template! "/lib/.+\\.rb$" "__module" 'enh-ruby-mode t)
|
|
|
|
(add-template! "\\.rb$" "__" 'enh-ruby-mode)
|
2015-06-24 15:32:34 +02:00
|
|
|
|
2015-09-30 13:52:02 -04:00
|
|
|
;; Rust
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "/Cargo.toml$" "__Cargo.toml" 'rust-mode)
|
|
|
|
(add-template! "/main\\.rs$" "__main.rs" 'rust-mode)
|
2015-06-24 15:32:34 +02:00
|
|
|
|
|
|
|
;; SCSS
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "/master\\.scss$" "__master.scss" 'scss-mode)
|
|
|
|
(add-template! "/normalize\\.scss$" "__normalize.scss" 'scss-mode)
|
|
|
|
(add-template! "\\.scss$" "__" 'scss-mode)
|
2015-06-24 15:32:34 +02:00
|
|
|
|
2015-09-30 13:52:02 -04:00
|
|
|
;; Shell scripts
|
2015-11-06 02:21:45 -05:00
|
|
|
(add-template! "\\.z?sh$" "__" 'sh-mode)
|
2015-09-30 13:52:02 -04:00
|
|
|
)
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
(provide 'core-auto-insert)
|
|
|
|
;;; core-auto-insert.el ends here
|