add basic support for the nim language
This commit is contained in:
parent
9e141cd01b
commit
12e26761e2
5 changed files with 77 additions and 0 deletions
|
@ -83,6 +83,7 @@
|
||||||
ledger ; an accounting system in Emacs
|
ledger ; an accounting system in Emacs
|
||||||
lua ; one-based indices? one-based indices
|
lua ; one-based indices? one-based indices
|
||||||
markdown ; writing docs for people to ignore
|
markdown ; writing docs for people to ignore
|
||||||
|
nim ; python+list at the speed of c
|
||||||
nix ; I hereby declare "nix geht mehr!"
|
nix ; I hereby declare "nix geht mehr!"
|
||||||
ocaml ; an objective camel
|
ocaml ; an objective camel
|
||||||
(org ; organize your plain life in plain text
|
(org ; organize your plain life in plain text
|
||||||
|
|
42
modules/lang/nim/README.org
Normal file
42
modules/lang/nim/README.org
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
#+TITLE: :lang Nim
|
||||||
|
|
||||||
|
#+begin_quote
|
||||||
|
This module is a work in progress.
|
||||||
|
#+end_quote
|
||||||
|
|
||||||
|
This module adds [[https://nim-lang.org][Nim]] support to Emacs.
|
||||||
|
|
||||||
|
+ Code completion (~nimsuggest+company~)
|
||||||
|
+ Syntax checking (~nimsugges+flycheck~)
|
||||||
|
+ Babel support (~ob-nim~)
|
||||||
|
#+begin_quote
|
||||||
|
...
|
||||||
|
#+end_quote
|
||||||
|
|
||||||
|
* Table of Contents :TOC:
|
||||||
|
- [[Install][Install]]
|
||||||
|
- [[Nim][Nim]]
|
||||||
|
|
||||||
|
* Install
|
||||||
|
** Nim
|
||||||
|
To get started with Nim, you can either use =choosenim= and install nim with:
|
||||||
|
|
||||||
|
~curl https://nim-lang.org/choosenim/init.sh -sSf | sh~
|
||||||
|
|
||||||
|
Or through your package manager:
|
||||||
|
|
||||||
|
*** MacOS
|
||||||
|
#+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes")
|
||||||
|
brew install nim
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
***
|
||||||
|
*** Arch Linux
|
||||||
|
#+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes")
|
||||||
|
sudo pacman --needed --noconfirm -S nim
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
|
*** Arch Linux
|
||||||
|
#+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes")
|
||||||
|
sudo pacman --needed --noconfirm -S nim
|
||||||
|
#+END_SRC
|
23
modules/lang/nim/config.el
Normal file
23
modules/lang/nim/config.el
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
;;; lang/nim/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(def-package! nim-mode
|
||||||
|
:init
|
||||||
|
(add-hook 'nim-mode-hook #'nimsuggest-mode))
|
||||||
|
|
||||||
|
(def-package! flycheck-nim
|
||||||
|
:when (featurep! :feature syntax-checker)
|
||||||
|
:after nim-mode
|
||||||
|
:config
|
||||||
|
(add-hook 'nimsuggest-mode-hook #'flycheck-mode)
|
||||||
|
|
||||||
|
(map! :map nim-mode-map
|
||||||
|
:localleader
|
||||||
|
:n "b" #'+nim/build-menu)
|
||||||
|
|
||||||
|
(def-menu! +nim/build-menu
|
||||||
|
"Building commands for `nim-mode' buffers."
|
||||||
|
'(("Build & run" :exec nim-compile))
|
||||||
|
:prompt "Build"))
|
||||||
|
|
||||||
|
(when (featurep! :completion company)
|
||||||
|
(add-hook 'nimsuggest-mode-hook #'company-mode))
|
9
modules/lang/nim/packages.el
Normal file
9
modules/lang/nim/packages.el
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
;; -*- no-byte-compile: t; -*-
|
||||||
|
;;; lang/nim/packages.el
|
||||||
|
|
||||||
|
;;; requires nim nimsuggest nimble
|
||||||
|
|
||||||
|
(package! nim-mode)
|
||||||
|
|
||||||
|
(when (featurep! :feature syntax-checker)
|
||||||
|
(package! flycheck-nim))
|
|
@ -18,6 +18,8 @@
|
||||||
(package! ob-sql-mode)
|
(package! ob-sql-mode)
|
||||||
(package! ob-translate)
|
(package! ob-translate)
|
||||||
|
|
||||||
|
(when (featurep! :lang nim)
|
||||||
|
(package! ob-nim))
|
||||||
(when (featurep! :lang crystal)
|
(when (featurep! :lang crystal)
|
||||||
(package! ob-crystal))
|
(package! ob-crystal))
|
||||||
(when (featurep! :lang go)
|
(when (featurep! :lang go)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue