2018-11-19 21:07:53 +00:00
|
|
|
;;; packages.el --- Nim Layer packages File for Spacemacs
|
|
|
|
;;
|
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
|
|
|
;;
|
|
|
|
;; Author: Max Gonzih
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-07-24 11:16:06 +00:00
|
|
|
(setq nim-packages
|
2018-11-20 19:55:37 +00:00
|
|
|
'(
|
|
|
|
company
|
2015-07-24 11:16:06 +00:00
|
|
|
flycheck
|
2015-10-21 18:27:48 +00:00
|
|
|
flycheck-nim
|
2018-11-20 19:55:37 +00:00
|
|
|
nim-mode
|
|
|
|
))
|
2015-07-24 11:16:06 +00:00
|
|
|
|
2015-10-11 03:19:23 +00:00
|
|
|
(defun nim/post-init-company ()
|
2017-01-02 05:39:04 +00:00
|
|
|
(spacemacs|add-company-backends
|
|
|
|
:backends company-capf
|
|
|
|
:modes nim-mode nimscript-mode))
|
2015-10-11 03:19:23 +00:00
|
|
|
|
|
|
|
(defun nim/post-init-flycheck ()
|
2017-02-14 03:27:29 +00:00
|
|
|
(spacemacs/enable-flycheck 'nim-mode))
|
2015-10-11 03:19:23 +00:00
|
|
|
|
|
|
|
(defun nim/init-flycheck-nim ()
|
|
|
|
(use-package flycheck-nim
|
2017-07-02 13:48:06 +00:00
|
|
|
:if (configuration-layer/package-used-p 'flycheck)))
|
2015-10-11 03:19:23 +00:00
|
|
|
|
2015-07-24 11:16:06 +00:00
|
|
|
(defun nim/init-nim-mode ()
|
|
|
|
(use-package nim-mode
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2016-09-15 11:04:48 +00:00
|
|
|
:init
|
2016-10-17 12:00:15 +00:00
|
|
|
(progn
|
|
|
|
(add-hook 'nim-mode-hook 'nimsuggest-mode)
|
2018-06-01 06:59:57 +00:00
|
|
|
(add-to-list 'spacemacs-jump-handlers-nim-mode 'nimsuggest-find-definition))
|
2015-07-24 11:16:06 +00:00
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(defun spacemacs/nim-compile-run ()
|
|
|
|
(interactive)
|
|
|
|
(shell-command "nim compile --run main.nim"))
|
2016-09-15 11:04:48 +00:00
|
|
|
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'nim-mode
|
2016-09-15 11:04:48 +00:00
|
|
|
"cr" 'spacemacs/nim-compile-run
|
2018-01-19 15:39:56 +00:00
|
|
|
"gb" 'pop-tag-mark
|
|
|
|
"hh" 'nimsuggest-show-doc))))
|