doomemacs/modules/lang/lua/config.el

41 lines
985 B
EmacsLisp
Raw Normal View History

2017-02-19 18:57:16 -05:00
;;; lang/lua/config.el --- lua + Love2D
2015-06-15 09:06:10 +02:00
(def-package! lua-mode
2015-06-15 09:06:10 +02:00
:mode "\\.lua$"
:interpreter "lua"
2017-02-19 18:57:16 -05:00
:init
(add-hook 'lua-mode-hook 'flycheck-mode)
:config
(set! :electric 'lua-mode :words '("else" "end"))
(set! :repl 'lua-mode '+lua/repl)
;; sp's lua-specific rules are obnoxious, so we disable them
(setq sp-pairs (delete (assq 'lua-mode sp-pairs) sp-pairs)))
2015-06-15 09:06:10 +02:00
2016-05-01 17:23:37 -04:00
(def-package! company-lua
:when (featurep! :completion company)
:after lua-mode
:config
(set! :company-backend 'lua-mode '(company-lua company-yasnippet)))
2017-02-19 18:57:16 -05:00
(def-package! moonscript
2016-05-01 17:23:37 -04:00
:mode ("\\.moon$" . moonscript-mode)
:config
2017-03-01 19:16:22 -05:00
(set! :editorconfig :add '(moonscript-mode moonscript-indent-offset)))
2016-05-01 17:23:37 -04:00
2017-02-19 18:57:16 -05:00
;;
2017-03-02 18:20:46 -05:00
;; Frameworks
2016-04-16 21:36:24 -04:00
;;
2017-02-19 18:57:16 -05:00
2017-03-02 18:20:46 -05:00
(def-project-mode! +lua-love-mode
:modes (lua-mode markdown-mode json-mode)
:files (and "main.lua" "conf.lua")
:init
2017-04-07 01:45:57 -04:00
(set! :build 'run-love-app '+lua-love-mode
2017-03-02 18:20:46 -05:00
(lambda ()
(async-shell-command (format "open -a love.app '%s'" (doom-project-root))))))
2017-02-19 18:57:16 -05:00