5a869764dd
- Add option to disable by default - Use local-vars hook to allow per-project enable/disable - Don’t enable helm-gtags-mode (no need) - Move emacs bindings from helm-gtags-mode-map to ggtags-mode-map
36 lines
900 B
EmacsLisp
36 lines
900 B
EmacsLisp
(setq lua-packages
|
|
'(
|
|
company
|
|
flycheck
|
|
ggtags
|
|
helm-gtags
|
|
lua-mode
|
|
))
|
|
|
|
(defun lua/post-init-flycheck ()
|
|
(spacemacs/add-flycheck-hook 'lua-mode))
|
|
|
|
(defun lua/init-lua-mode ()
|
|
(use-package lua-mode
|
|
:defer t
|
|
:mode ("\\.lua\\'" . lua-mode)
|
|
:interpreter ("lua" . lua-mode)
|
|
:init
|
|
(progn
|
|
(setq lua-indent-level 2
|
|
lua-indent-string-contents t)
|
|
(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))))
|
|
|
|
(defun lua/post-init-company ()
|
|
(add-hook 'lua-mode-hook 'company-mode))
|
|
|
|
(defun lua/post-init-ggtags ()
|
|
(add-hook 'lua-mode-local-vars-hook #'spacemacs/ggtags-mode-enable))
|
|
|
|
(defun lua/post-init-helm-gtags ()
|
|
(spacemacs/helm-gtags-define-keys-for-mode 'lua-mode))
|