Commit 75e58283 authored by marc0s's avatar marc0s

feat: setup lua

parent 9f6823a2
......@@ -88,6 +88,7 @@
(global-set-key (kbd "C-x k") 'kill-this-buffer)
;; manage largefiles
(defun my-find-file-check-make-large-file-read-only-hook ()
"If a file is over a given size, make the buffer read only."
......@@ -170,7 +171,10 @@ work here..."
(window-height . 0.2)))
(defun my/use-eslintd ()
(setq-local flycheck-javascript-eslint-executable (concat (getenv "NVM_BIN") "/eslint_d")))
(defun my/luacheck ()
(setq-local flycheck-lua-luacheck-executable (concat (getenv "HOME") "/.luarocks/bin/luacheck")))
(add-hook 'flycheck-mode-hook #'my/use-eslintd)
(add-hook 'flycheck-mode-hook #'my/luacheck)
(use-package flycheck-pos-tip
:ensure t
......@@ -275,6 +279,12 @@ work here..."
(add-hook 'json-mode-hook 'marc0s/json-mode-hook))
(use-package lua-mode
:ensure t
;; TODO set up TABs as indent, not the default weird one :S
(add-hook 'lua-mode-hook 'flycheck-mode))
(use-package magit
:ensure t
:bind (("C-c g" . magit-status)
......@@ -317,8 +327,12 @@ work here..."
:ensure t
:commands lsp
(setq lsp-auto-configure t)
;; lsp is not stable, crashes a lot
;;(add-hook 'lua-mode-hook #'lsp)
(add-hook 'js2-mode-hook #'lsp))
(use-package lsp-ui
:ensure t
:commands lsp-ui-mode
......@@ -329,21 +343,6 @@ work here..."
(push 'company-lsp company-backends))
(use-package lua-mode
:ensure t
(defun marc0s/lua-indent ()
"Sets the indentation to use tabs"
(setq indent-tabs-mode t
tab-width lua-indent-level))
(add-hook 'lua-mode-hook 'marc0s/lua-indent)
;; (defun marc0s/lua-at-most-one-indent (old-function &rest arguments)
;; (let ((old-res (apply old-function arguments)))
;; (if (> old-res 2) 2 old-res)))
;; (advice-add #'lua-calculate-indentation-block-modifier :around #'marc0s/lua-at-most-one-indent)
(use-package plantuml-mode
:ensure t
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment