spacemacs/layers/+lang/nim
Arif Er 00f9ab19ac chore: update copyright headers to 2022
The script used to identify and update the change is added into the GitHub
workflows script directory. A workflow action can be created to trigger the
script to update the headers on the first of every new year. Possibly a task for
a consequent PR.
2022-06-03 17:32:20 +02:00
..
img Use + instead of ! for layer categories 2015-09-11 00:13:51 -04:00
README.org documentation formatting: Fri Aug 7 11:44:44 UTC 2020 2020-08-07 13:54:27 +02:00
config.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00
funcs.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00
layers.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00
packages.el chore: update copyright headers to 2022 2022-06-03 17:32:20 +02:00

README.org

Nim layer

/TakeV/spacemacs/media/branch/develop/layers/+lang/nim/img/logo.png

Description

This layer adds support for the multi-paradigm language Nim.

Features:

  • Auto-completion
  • Syntax-checking
  • Jump to definition.

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add nim to the existing dotspacemacs-configuration-layers list in this file.

For syntax checking, the syntax-checking layer must also be added.

Configuration

All layer configurations can be done by setting layer variables in your dotfile. No custom user config lines are necessary

Choosing a backend

This layer provides two alternative backends to choose from.

Company-vim

This is the default choice if nothing is set and no lsp layer is loaded in your dotfile. This mode only provides very limited IDE capabilities. Used best if only small scripts are edited. To set explicitly set the following in your dotfile:

  (nim :variables nim-backend 'company-nim)

LSP

For proper IDE support this backend should be used. It is based on an external server which will be started automatically by emacs, once a nim file is opened. The key bindings are the same for all lsp modes so if you are already familiar with one you should be able to work the same in all modes.

To set explicitly do the following in your dotfile:

  (nim :variables
        nim-backend 'lsp)

For this to work you will also need to install the latest version of the lsp server by running:

  nimble install nimlsp

Should this not work than further instructions can be obtained from here.

NOTE: Key bindings for LSP are defined in the LSP layer. Also it is advisable to have a look at the autocomplete layer for an optimal intellisense config for LSP.

Key bindings

Key binding Description
SPC m c r nim compile --run main.nim
SPC m g b Jump back
SPC m h h Show symbol's documentation