feature/file-templates: fix doom file templates

This commit is contained in:
Henrik Lissner 2018-02-17 19:15:13 -05:00
parent 7ac29bbd27
commit a862d0eeb1
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -48,76 +48,77 @@
`(lambda () (+file-templates--expand ,trigger ',mode ,project-only-p))) `(lambda () (+file-templates--expand ,trigger ',mode ,project-only-p)))
#'ignore)))) #'ignore))))
(mapc #'+file-templates-add (let ((doom (concat "/" (regexp-opt '(".emacs.d" ".doom.d" "doom-emacs" "doom")) "/.*")))
;; General (mapc #'+file-templates-add
'(("/\\.gitignore$" "__" gitignore-mode) ;; General
("/Dockerfile$" "__" dockerfile-mode) `(("/\\.gitignore$" "__" gitignore-mode)
("/docker-compose.yml$" "__" yaml-mode) ("/Dockerfile$" "__" dockerfile-mode)
;; C/C++ ("/docker-compose.yml$" "__" yaml-mode)
("\\.h$" "__h" c-mode) ;; C/C++
("\\.c$" "__c" c-mode) ("\\.h$" "__h" c-mode)
("\\.h\\(h\\|pp|xx\\)$" "__hpp" c++-mode) ("\\.c$" "__c" c-mode)
("\\.\\(cc\\|cpp\\)$" "__cpp" c++-mode) ("\\.h\\(h\\|pp|xx\\)$" "__hpp" c++-mode)
("/main\\.\\(cc\\|cpp\\)$" "__main.cpp" c++-mode) ("\\.\\(cc\\|cpp\\)$" "__cpp" c++-mode)
("/win32_\\.\\(cc\\|cpp\\)$" "__winmain.cpp" c++-mode) ("/main\\.\\(cc\\|cpp\\)$" "__main.cpp" c++-mode)
("/Makefile$" "__" makefile-gmake-mode) ("/win32_\\.\\(cc\\|cpp\\)$" "__winmain.cpp" c++-mode)
;; Elisp ("/Makefile$" "__" makefile-gmake-mode)
("\\.el$" "__initfile" emacs-lisp-mode) ;; Elisp
("/.dir-locals.el$" nil) ("\\.el$" "__initfile" emacs-lisp-mode)
("-test\\.el$" "__" emacs-ert-mode) ("/.dir-locals.el$" nil)
("/\\(?:.emacs.d\\|doom-emacs\\)?/.+\\.el$" "__doom-module" emacs-lisp-mode) ("-test\\.el$" "__" emacs-ert-mode)
("/\\(?:.emacs.d\\|doom-emacs\\)?/.+/packages\\.el$" "__doom-packages" emacs-lisp-mode) (,(concat doom "/.+\\.el$") "__doom-module" emacs-lisp-mode)
("/\\(?:.emacs.d\\|doom-emacs\\)?/.+/test/.+\\.el$" "__doom-test" emacs-lisp-mode) (,(concat doom "/packages\\.el$") "__doom-packages" emacs-lisp-mode)
(snippet-mode "__" snippet-mode) (,(concat doom "/test/.+\\.el$") "__doom-test" emacs-lisp-mode)
;; Go (snippet-mode "__" snippet-mode)
("\\.go$" "__.go" go-mode) ;; Go
("/main\\.go$" "__main.go" go-mode t) ("\\.go$" "__.go" go-mode)
;; HTML ("/main\\.go$" "__main.go" go-mode t)
("\\.html$" "__.html" web-mode) ;; HTML
;; java ("\\.html$" "__.html" web-mode)
("/src/.+/.+\\.java$" "__" java-mode) ;; java
("/main\\.java$" "__main" java-mode) ("/src/.+/.+\\.java$" "__" java-mode)
("/build\\.gradle$" "__build.gradle" android-mode) ("/main\\.java$" "__main" java-mode)
;; Javascript ("/build\\.gradle$" "__build.gradle" android-mode)
("\\.\\(json\\|jshintrc\\)$" "__" json-mode) ;; Javascript
("/package\\.json$" "__package.json" json-mode) ("\\.\\(json\\|jshintrc\\)$" "__" json-mode)
("/bower\\.json$" "__bower.json" json-mode) ("/package\\.json$" "__package.json" json-mode)
("/gulpfile\\.js$" "__gulpfile.js" js-mode) ("/bower\\.json$" "__bower.json" json-mode)
("/webpack\\.config\\.js$" "__webpack.config.js" js-mode) ("/gulpfile\\.js$" "__gulpfile.js" js-mode)
;; Lua ("/webpack\\.config\\.js$" "__webpack.config.js" js-mode)
("/main\\.lua$" "__main.lua" love-mode) ;; Lua
("/conf\\.lua$" "__conf.lua" love-mode) ("/main\\.lua$" "__main.lua" love-mode)
;; Markdown ("/conf\\.lua$" "__conf.lua" love-mode)
("\\.md$" "__" markdown-mode) ;; Markdown
;; Org ("\\.md$" "__" markdown-mode)
("\\.org$" "__" org-mode) ;; Org
("/\\(?:.emacs.d\\|doom-emacs\\)?/.+/README\\.org$" "__doom-readme" org-mode) ("\\.org$" "__" org-mode)
;; PHP (,(concat doom "/README\\.org$") "__doom-readme" org-mode)
("\\.php$" "__" php-mode) ;; PHP
("\\.class\\.php$" "__.class.php" php-mode) ("\\.php$" "__" php-mode)
;; Python ("\\.class\\.php$" "__.class.php" php-mode)
;;("tests?/test_.+\\.py$" "__" nose-mode) ;; Python
;;("/setup\\.py$" "__setup.py" python-mode) ;;("tests?/test_.+\\.py$" "__" nose-mode)
("\\.py$" "__" python-mode) ;;("/setup\\.py$" "__setup.py" python-mode)
;; Ruby ("\\.py$" "__" python-mode)
("\\.rb$" "__" ruby-mode) ;; Ruby
("/Rakefile$" "__Rakefile" ruby-mode t) ("\\.rb$" "__" ruby-mode)
("/Gemfile$" "__Gemfile" ruby-mode t) ("/Rakefile$" "__Rakefile" ruby-mode t)
("/\\.rspec$" "__.rspec" rspec-mode) ("/Gemfile$" "__Gemfile" ruby-mode t)
("\\.gemspec$" "__.gemspec" ruby-mode t) ("/\\.rspec$" "__.rspec" rspec-mode)
("/spec_helper\\.rb$" "__helper" rspec-mode t) ("\\.gemspec$" "__.gemspec" ruby-mode t)
("/lib/.+\\.rb$" "__module" ruby-mode t) ("/spec_helper\\.rb$" "__helper" rspec-mode t)
("_spec\\.rb$" "__" rspec-mode t) ("/lib/.+\\.rb$" "__module" ruby-mode t)
;; Rust ("_spec\\.rb$" "__" rspec-mode t)
("/main\\.rs$" "__main.rs" rust-mode) ;; Rust
("/Cargo.toml$" "__Cargo.toml" rust-mode) ("/main\\.rs$" "__main.rs" rust-mode)
;; SCSS ("/Cargo.toml$" "__Cargo.toml" rust-mode)
("\\.scss$" "__" scss-mode) ;; SCSS
("/master\\.scss$" "__master.scss" scss-mode) ("\\.scss$" "__" scss-mode)
("/normalize\\.scss$" "__normalize.scss" scss-mode) ("/master\\.scss$" "__master.scss" scss-mode)
;; Slim ("/normalize\\.scss$" "__normalize.scss" scss-mode)
("/\\(index\\|main\\)\\.slim$" "__" slim-mode) ;; Slim
;; Shell scripts ("/\\(index\\|main\\)\\.slim$" "__" slim-mode)
("\\.z?sh$" "__" sh-mode) ;; Shell scripts
("\\.fish$" "__" fish-mode) ("\\.z?sh$" "__" sh-mode)
("\\.zunit$" "__zunit" sh-mode)))) ("\\.fish$" "__" fish-mode)
("\\.zunit$" "__zunit" sh-mode)))))