mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 11:30:23 +10:00
Moving to Doom Emacs!
This commit is contained in:
48
.emacs.d/modules/lang/lua/config.el
Normal file
48
.emacs.d/modules/lang/lua/config.el
Normal file
@@ -0,0 +1,48 @@
|
||||
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; sp's default rules are obnoxious, so disable them
|
||||
(provide 'smartparens-lua)
|
||||
|
||||
|
||||
;;
|
||||
;; Major modes
|
||||
|
||||
(use-package! lua-mode
|
||||
:defer t
|
||||
:init
|
||||
;; lua-indent-level defaults to 3 otherwise. Madness.
|
||||
(setq lua-indent-level 2)
|
||||
: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)))
|
||||
|
||||
|
||||
(use-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-h
|
||||
#'+lua-moonscript-fontify-interpolation-h)
|
||||
(when (featurep! :tools flycheck)
|
||||
(require 'flycheck-moonscript nil t)))
|
||||
|
||||
|
||||
;;
|
||||
;;; 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)))
|
||||
Reference in New Issue
Block a user