nim-wiki/Editor-Support.md

4.3 KiB

If you add more editor support, don't forget to add it to the FAQ as well.

The following editors have some Nim support:

Emacs

Vim

LiClipse

LiClipse is a plugin for Eclipse (which also provides a standalone version for convenience) which provides Nim support providing syntax-highlighting, outline, comment/uncomment (ctrl+/), select/deselect scope (Shift+Alt+Up/Down), auto-indent, mark occurrences, user templates, multiple cursors (Ctrl+K or Ctrl+Alt+mouse select) and indent guides.

Scite

Recent versions of Scite have out-of-the-box support for Nim. For older versions:
http://sourceforge.net/p/scintilla/scite/ci/default/tree/src/nimrod.properties?format=raw

To enable nim, edit the global config file: (from http://forum.nim-lang.org/t/312)

  • remove nimrod from the list in imports.exclude=(...lots of stuff)
  • edit source.files to make scintilla recognise .nim

Aporia

Aporia is a Nim IDE written in Nim.

https://github.com/nim-lang/Aporia/

LightTable

https://github.com/zah/nim.lt/

Atom

Gedit/Other GtkSourceView editors

There is a .lang file for gedit here

Geany

There is a pull request to provide Nim support in Geany.

Ctags

Basic ~/.ctags rules for Nim code (Feel free to improve and contribute) Don't use this if possible, Nim idetools provides better results.

--langdef=nim
--langmap=nim:.nim
--regex-nim=/(\w+)\*?\s*=\s*object/\1/t,class/
--regex-nim=/(\w+)\*?\s*=\s*enum/\1/t,enum/
--regex-nim=/(\w+)\*?\s*=\s*tuple/\1/t,tuple/
--regex-nim=/(\w+)\*?\s*=\s*range/\1/t,subrange/
--regex-nim=/(\w+)\*?\s*=\s*proc/\1/t,proctype/
--regex-nim=/proc\s+(\w+)/\1/f,procedure/
--regex-nim=/method\s+(\w+)/\1/f,method/
--regex-nim=/proc\s+`([^`]+)`/\1/o,operator/
--regex-nim=/template\s+(\w+)/\1/t,template/
--regex-nim=/macro\s+(\w+)/\1/m,macro/

Alternatively, there's a native tags generator specifically for Nim: https://bitbucket.org/nimcontrib/ntags

jEdit

https://github.com/exhu/nimrod-misc/tree/master/jedit

Sublime

Kate

Syntax highlighting:

https://github.com/PhilipWitte/NimKate

TextMate

Available from the bundle installer in preferences (repository).

QtCreator

https://github.com/filcuc/NimQtCreatorPlugin

QtCreator plugin that supports:

  • Syntax highlighting
  • Indentation
  • Project management (build/run configuration)
  • Debug with gdb

KDevelop

https://github.com/xyz32/KDevelop-template

Demo: https://vimeo.com/135918228

KDevelop templates for Nim project and Nim file:

  • Project management (build/run configuration)
  • New nim file
  • Debug with gdb (You will need to uncomment the debug flag in the nim.cfg file)
  • Syntax Highlighting (Needs Kate syntax highlighting).

Make sure you have both Nim and Nimble installed.

Howl

http://howl.io

Recent versions of Howl have built-in Nim syntax highlighting.