doomemacs/modules/lang/lua/config.el
Henrik Lissner 0a84d2f0a9
core-lib: add auto-minor-mode, revise def-project-mode!
- Adds the auto-minor-mode package to replace our in-house
  implementation.
- Merges associate! into the def-project-mode! macro because associate!
  on its own is less useful than auto-minor-mode-alist,
  auto-minor-mode-magic-alist or hooks.
- Changes the semantics of :modes and :add-hooks properties of
  def-project-mode!. Its arguments are evaluated as is; lists will need
  to be quoted.

squash! core-lib: remove associate! macro
2019-07-22 02:30:39 +02:00

46 lines
1.2 KiB
EmacsLisp

;;; lang/lua/config.el -*- lexical-binding: t; -*-
;; sp's default rules are obnoxious, so disable them
(provide 'smartparens-lua)
;;
;; Major modes
(def-package! lua-mode
:defer t
:init
;; lua-indent-level defaults to 3 otherwise. Madness.
(setq lua-indent-level tab-width)
:config
(set-lookup-handlers! 'lua-mode :documentation 'lua-search-documentation)
(set-electric! 'lua-mode :words '("else" "end"))
(set-repl-handler! 'lua-mode #'+lua/open-repl)
(set-company-backend! 'lua-mode '(company-lua company-yasnippet)))
(def-package! moonscript
:when (featurep! +moonscript)
:defer t
:config
(setq-hook! 'moonscript-mode-hook
moonscript-indent-offset tab-width)
(add-hook! 'moonscript-mode-hook
#'(+lua|moonscript-fix-single-quotes
+lua|moonscript-fontify-interpolation)))
;;
;;; Frameworks
(def-project-mode! +lua-love-mode
:modes '(moonscript-mode lua-mode markdown-mode json-mode)
:when #'+lua-love-project-root
:on-load
(progn
(set-project-type! 'love2d
:predicate #'+lua-love-project-root
:run #'+lua-love-build-command)
(map! :localleader
:map +lua-love-mode-map
"b" #'+lua/run-love-game)))