ebe4c60264
This reverts commit 29c78ce841
and all other fixes
that have been made afterwards.
The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
35 lines
932 B
EmacsLisp
35 lines
932 B
EmacsLisp
(setq nim-packages
|
|
'(company
|
|
flycheck
|
|
flycheck-nim
|
|
nim-mode))
|
|
|
|
(defun nim/post-init-company ()
|
|
(spacemacs|add-company-backends
|
|
:backends company-capf
|
|
:modes nim-mode nimscript-mode))
|
|
|
|
(defun nim/post-init-flycheck ()
|
|
(spacemacs/enable-flycheck 'nim-mode))
|
|
|
|
(defun nim/init-flycheck-nim ()
|
|
(use-package flycheck-nim
|
|
:if (configuration-layer/package-used-p 'flycheck)))
|
|
|
|
(defun nim/init-nim-mode ()
|
|
(use-package nim-mode
|
|
:defer t
|
|
:init
|
|
(progn
|
|
(add-hook 'nim-mode-hook 'nimsuggest-mode)
|
|
(push 'nimsuggest-find-definition spacemacs-jump-handlers-nim-mode))
|
|
:config
|
|
(progn
|
|
(defun spacemacs/nim-compile-run ()
|
|
(interactive)
|
|
(shell-command "nim compile --run main.nim"))
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'nim-mode
|
|
"cr" 'spacemacs/nim-compile-run
|
|
"gb" 'pop-tag-mark
|
|
"hh" 'nimsuggest-show-doc))))
|