2016-12-02 18:42:11 +00:00
|
|
|
;;; packages.el --- Lua Layer packages File for Spacemacs
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2016-12-02 18:42:11 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
;;
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
;;
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2016-12-02 18:42:11 +00:00
|
|
|
|
2021-02-13 21:53:57 +00:00
|
|
|
(defconst lua-packages
|
|
|
|
'(
|
|
|
|
company
|
|
|
|
(company-lua :requires company)
|
|
|
|
flycheck
|
|
|
|
ggtags
|
|
|
|
counsel-gtags
|
|
|
|
helm-gtags
|
|
|
|
lua-mode))
|
2015-01-14 03:31:40 +00:00
|
|
|
|
2015-04-04 05:02:37 +00:00
|
|
|
(defun lua/post-init-flycheck ()
|
2017-02-14 03:27:29 +00:00
|
|
|
(spacemacs/enable-flycheck 'lua-mode))
|
2015-04-04 05:02:37 +00:00
|
|
|
|
2015-01-14 03:31:40 +00:00
|
|
|
(defun lua/init-lua-mode ()
|
|
|
|
(use-package lua-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-01-14 03:31:40 +00:00
|
|
|
:mode ("\\.lua\\'" . lua-mode)
|
|
|
|
:interpreter ("lua" . lua-mode)
|
2021-02-13 21:53:57 +00:00
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(spacemacs/register-repl 'lua #'lua-show-process-buffer "lua")
|
|
|
|
(add-hook 'lua-mode-local-vars-hook #'spacemacs//lua-setup-backend)
|
|
|
|
|
|
|
|
;; Set global settings
|
|
|
|
(setq lua-indent-level 2
|
|
|
|
lua-indent-string-contents t)
|
|
|
|
|
|
|
|
;; Set general bindings
|
|
|
|
(spacemacs/declare-prefix-for-mode 'lua-mode "ms" "REPL")
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'lua-mode
|
|
|
|
"hd" 'lua-search-documentation
|
|
|
|
"sb" 'lua-send-buffer
|
|
|
|
"sf" 'lua-send-defun
|
|
|
|
"sl" 'lua-send-current-line
|
|
|
|
"sr" 'lua-send-region
|
|
|
|
"'" 'lua-show-process-buffer)
|
|
|
|
|
|
|
|
;; Set lua-mode specific bindings
|
2021-02-13 22:20:37 +00:00
|
|
|
(when (eq (spacemacs//lua-backend) `lua-mode)
|
2021-02-13 21:53:57 +00:00
|
|
|
(spacemacs/declare-prefix-for-mode 'lua-mode "mh" "help")
|
|
|
|
(spacemacs/declare-prefix-for-mode 'lua-mode "mg" "goto")))))
|
2015-05-28 18:06:50 +00:00
|
|
|
|
|
|
|
(defun lua/post-init-company ()
|
2019-11-12 03:29:50 +00:00
|
|
|
(add-hook 'lua-mode-local-vars-hook #'spacemacs//lua-setup-company))
|
2016-04-05 04:08:34 +00:00
|
|
|
|
2016-12-07 10:35:18 +00:00
|
|
|
(defun lua/init-company-lua ()
|
|
|
|
(use-package company-lua
|
2021-02-13 21:53:57 +00:00
|
|
|
:if (eq (spacemacs//lua-backend) 'lua-mode)
|
2019-11-30 23:39:37 +00:00
|
|
|
:defer t))
|
2016-12-07 10:35:18 +00:00
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun lua/post-init-ggtags ()
|
2016-08-15 19:24:44 +00:00
|
|
|
(add-hook 'lua-mode-local-vars-hook #'spacemacs/ggtags-mode-enable))
|
2016-04-05 04:08:34 +00:00
|
|
|
|
2017-08-26 21:18:09 +00:00
|
|
|
(defun lua/post-init-counsel-gtags ()
|
|
|
|
(spacemacs/counsel-gtags-define-keys-for-mode 'lua-mode))
|
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun lua/post-init-helm-gtags ()
|
|
|
|
(spacemacs/helm-gtags-define-keys-for-mode 'lua-mode))
|