2018-03-18 15:31:32 -04:00
|
|
|
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2018-06-25 15:54:38 +02:00
|
|
|
;; sp's default rules are obnoxious, so disable them
|
|
|
|
(provide 'smartparens-lua)
|
|
|
|
|
2018-09-07 19:36:16 -04:00
|
|
|
|
2019-01-25 03:10:28 -05:00
|
|
|
;;
|
|
|
|
;; Major modes
|
|
|
|
|
|
|
|
(def-package! lua-mode
|
2019-02-16 19:03:36 -05:00
|
|
|
:defer t
|
2019-01-25 03:10:28 -05:00
|
|
|
:init
|
|
|
|
;; lua-indent-level defaults to 3 otherwise. Madness.
|
|
|
|
(setq lua-indent-level tab-width)
|
|
|
|
:config
|
2018-06-15 17:27:48 +02:00
|
|
|
(set-lookup-handlers! 'lua-mode :documentation 'lua-search-documentation)
|
2018-06-15 12:30:56 +02:00
|
|
|
(set-electric! 'lua-mode :words '("else" "end"))
|
2019-02-18 01:56:38 -05:00
|
|
|
(set-repl-handler! 'lua-mode #'+lua/open-repl)
|
2018-09-04 03:04:00 +02:00
|
|
|
(set-company-backend! 'lua-mode '(company-lua company-yasnippet)))
|
2015-06-15 09:06:10 +02:00
|
|
|
|
2016-05-01 17:23:37 -04:00
|
|
|
|
2019-07-09 01:01:44 +02:00
|
|
|
(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)))
|
2016-05-01 17:23:37 -04:00
|
|
|
|
2017-02-19 18:57:16 -05:00
|
|
|
|
|
|
|
;;
|
2019-04-06 00:35:43 -04:00
|
|
|
;;; Frameworks
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2017-03-02 18:20:46 -05:00
|
|
|
(def-project-mode! +lua-love-mode
|
2019-07-09 01:01:44 +02:00
|
|
|
:modes (moonscript-mode lua-mode markdown-mode json-mode)
|
|
|
|
:when #'+lua-love-project-root
|
2018-09-04 03:04:00 +02:00
|
|
|
:on-load
|
2019-06-27 20:26:29 +03:00
|
|
|
(progn
|
|
|
|
(set-project-type! 'love2d
|
|
|
|
:predicate #'+lua-love-project-root
|
2019-07-09 01:01:44 +02:00
|
|
|
:run #'+lua-love-build-command)
|
2019-06-27 20:26:29 +03:00
|
|
|
(map! :localleader
|
|
|
|
:map +lua-love-mode-map
|
|
|
|
"b" #'+lua/run-love-game)))
|