2016-12-02 18:42:11 +00:00
|
|
|
;;; packages.el --- Lua Layer packages File for Spacemacs
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 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.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-04-19 03:40:24 +00:00
|
|
|
(setq lua-packages
|
2016-12-02 18:42:11 +00:00
|
|
|
'(
|
|
|
|
company
|
2017-07-03 07:52:54 +00:00
|
|
|
(company-lua :requires company)
|
2016-12-02 18:42:11 +00:00
|
|
|
flycheck
|
|
|
|
ggtags
|
2017-08-26 21:18:09 +00:00
|
|
|
counsel-gtags
|
2016-12-02 18:42:11 +00:00
|
|
|
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
|
|
|
|
:defer t
|
|
|
|
:mode ("\\.lua\\'" . lua-mode)
|
|
|
|
:interpreter ("lua" . lua-mode)
|
2016-05-05 12:15:25 +00:00
|
|
|
:init
|
2015-01-14 03:31:40 +00:00
|
|
|
(progn
|
|
|
|
(setq lua-indent-level 2
|
|
|
|
lua-indent-string-contents t)
|
2016-05-05 12:15:25 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'lua-mode
|
|
|
|
"d" 'lua-search-documentation
|
|
|
|
"sb" 'lua-send-buffer
|
|
|
|
"sf" 'lua-send-defun
|
|
|
|
"sl" 'lua-send-current-line
|
|
|
|
"sr" 'lua-send-region))))
|
2015-05-28 18:06:50 +00:00
|
|
|
|
|
|
|
(defun lua/post-init-company ()
|
|
|
|
(add-hook 'lua-mode-hook 'company-mode))
|
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
|
|
|
|
:defer t
|
2017-05-15 01:26:41 +00:00
|
|
|
:init (spacemacs|add-company-backends
|
|
|
|
:backends company-lua
|
|
|
|
:modes lua-mode)))
|
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))
|