doomemacs/modules/module-lua.el

42 lines
1.3 KiB
EmacsLisp
Raw Normal View History

2015-06-15 09:06:10 +02:00
;;; module-lua.el --- lua + Love2D
(use-package lua-mode
:mode "\\.lua$"
:interpreter "lua"
:init
(def-company-backend! lua-mode (yasnippet))
(def-electric! lua-mode :words ("else" "end"))
(def-repl! lua-mode narf/inf-lua)
2016-04-06 03:23:11 -04:00
(add-hook 'lua-mode-hook 'flycheck-mode)
2016-03-28 21:39:13 -04:00
:config
(sp-with-modes '(lua-mode)
;; disable defaults
(sp-local-pair "if" nil :actions :rem)
(sp-local-pair "while" nil :actions :rem)
(sp-local-pair "function" nil :actions :rem)
(sp-local-pair "then " " end")
(sp-local-pair "do " " end")
(sp-local-pair "then" "end" :when '(("RET")) :post-handlers '("||\n[i]"))
(sp-local-pair "do" "end" :when '(("RET")) :post-handlers '("||\n[i]"))
2016-03-23 11:59:06 -04:00
2016-03-31 03:22:34 -04:00
;; block functions
(sp-local-pair "function" "end" :when '(sp-point-after-bol-p) :post-handlers '(" |\n[i]"))
;; inline functions
(sp-local-pair "function " " end" :unless '(sp-point-after-bol-p))))
2015-06-15 09:06:10 +02:00
2016-04-16 21:36:24 -04:00
;;
(def-project-type! love ""
2016-04-16 21:36:24 -04:00
:modes (lua-mode markdown-mode json-mode)
:files ("main.lua" "conf.lua")
:build ("open -a love.app '%s'" "main.lua"))
2015-06-15 09:06:10 +02:00
(def-project-type! hammerspoon "hammer"
2016-04-16 21:36:24 -04:00
:modes (lua-mode markdown-mode)
:match "/\\.?hammerspoon/.+\\.lua$"
:build "open hammerspoon://reload")
2016-01-29 07:04:14 -05:00
2015-06-15 09:06:10 +02:00
(provide 'module-lua)
;;; module-lua.el ends here