nim: move local packages to local folder and simplify config

This commit is contained in:
syl20bnr 2015-10-10 23:19:23 -04:00
parent 56ecd43753
commit 6edfdb550e
3 changed files with 14 additions and 22 deletions

View File

@ -1,11 +0,0 @@
(setq nim-pre-extensions
'())
(setq nim-post-extensions
;; taken from https://github.com/ALSchwalm/flycheck-nim
'(flycheck-nim))
(defun nim/init-flycheck-nim ()
(spacemacs/add-flycheck-hook 'nim-mode)
(use-package flycheck-nim
:if (configuration-layer/layer-usedp 'syntax-checking)))

View File

@ -1,26 +1,29 @@
(setq nim-packages
'(company
company-nim
flycheck
(flycheck-nim :location local)
nim-mode))
(defun nim/post-init-company ()
(spacemacs|add-company-hook nim-mode))
(defun nim/post-init-flycheck ()
(spacemacs/add-flycheck-hook 'nim-mode))
(defun nim/init-flycheck-nim ()
(use-package flycheck-nim
:if (configuration-layer/package-usedp 'flycheck)))
(defun nim/init-nim-mode ()
(use-package nim-mode
:defer t
:init (when (configuration-layer/package-usedp 'company)
(push 'company-nim company-backends-nim-mode))
:config
(progn
(defun spacemacs/nim-compile-run ()
(interactive)
(shell-command "nim compile --run main.nim"))
(evil-leader/set-key-for-mode 'nim-mode
"mcr" 'spacemacs/nim-compile-run))))
(when (configuration-layer/layer-usedp 'auto-completion)
(defun nim/post-init-company ()
(spacemacs|add-company-hook nim-mode))
(defun nim/init-company-nim ()
(use-package company-nim
:defer t
:init
(push 'company-nim company-backends-nim-mode))))