Major refactor & optimization of how modules load their packages
Now that we are loading package autoloads files (as part of the generated doom-package-autoload-file when running make autoloads), many :commands properties are redundant. In fact, many def-package! blocks are redundant. In some cases, we can do without a config.el file entirely, and can move into the autoloads file or rely entirely on package autoloads. Also, many settings have been moved in their module's autoloads files, which makes them available ASAP; their use no longer depends on module load order. This gained me a modest ~10% boost in startup speed.
This commit is contained in:
parent
6a140209b8
commit
09cb4f6716
93 changed files with 644 additions and 846 deletions
|
@ -1,18 +1,12 @@
|
|||
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(def-package! lua-mode
|
||||
:mode "\\.lua$"
|
||||
:interpreter "lua"
|
||||
:init
|
||||
;; sp's default lua rules are obnoxious, so disable them. Use snippets
|
||||
;; instead!
|
||||
(provide 'smartparens-lua)
|
||||
:config
|
||||
(after! lua-mode
|
||||
(add-hook 'lua-mode-hook #'flycheck-mode)
|
||||
|
||||
(set! :lookup 'lua-mode :documentation 'lua-search-documentation)
|
||||
(set! :electric 'lua-mode :words '("else" "end"))
|
||||
(set! :repl 'lua-mode #'+lua/repl)
|
||||
(set! :company-backend 'lua-mode '(company-lua company-yasnippet))
|
||||
|
||||
(def-menu! +lua/build-menu
|
||||
"Build/compilation commands for `lua-mode' buffers."
|
||||
|
@ -24,15 +18,8 @@
|
|||
:n "b" #'+lua/build-menu))
|
||||
|
||||
|
||||
(def-package! company-lua
|
||||
:after (:all company lua-mode)
|
||||
:config
|
||||
(set! :company-backend 'lua-mode '(company-lua company-yasnippet)))
|
||||
|
||||
|
||||
(def-package! moonscript
|
||||
:mode ("\\.moon$" . moonscript-mode)
|
||||
:config (defvaralias 'moonscript-indent-offset 'tab-width))
|
||||
(after! moonscript
|
||||
(defvaralias 'moonscript-indent-offset 'tab-width))
|
||||
|
||||
|
||||
;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue