doomemacs/modules/lang/lua/config.el
Henrik Lissner 22cc519ac1
Add set-project-type! autodef
And use it for love2d projects in lang/lua module.
2019-06-27 17:16:40 +02:00

38 lines
974 B
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)))
;;;###package moonscript
(setq-hook! 'moonscript-mode-hook moonscript-indent-offset tab-width)
;;
;;; Frameworks
(def-project-mode! +lua-love-mode
:modes (lua-mode markdown-mode json-mode)
:files (and "main.lua" "conf.lua")
:on-load
(set-project-type! 'love2d
:predicate #'+lua-love-project-root
:run #'+lua/run-love-game)
(map! :localleader
:map +lua-love-mode-map
"b" #'+lua/run-love-game))