nim(9)
[Home]
[Commands]
[Variables]
[Macro-Dev]
[Glossary]
SYNOPSIS
FILES
hknim.emf - Nim programming language hook definition
nim.eaf - Nim programming language abbreviation file
nim.etf - Nim programming language template file
EXTENSIONS
DESCRIPTION
General Editing
On creating a new file, a new header is automatically included into the file.
time(2m) is by default enabled, allowing the modification time-stamp to be maintained in the header.
Hilighting
The hilighting features allow commands, variables, logical, comments, strings and characters of the language to be differentiated and rendered in different colors.
Auto Layout
The command
indent(2) performs automatic layout of the text.
Comments may be formatted using esc o, which reformats the comments according to the current fill paragraph. If a comment commences with /***... then the comment is automatically formatted to a box.
Folding and Information Hiding
Generic folding is enabled within the Nim file. The folds occur about functions and classes definition and their opening brace and a closing curly brace at the beginning of a line.
collapse-all(3) (un)folds all regions in the file,
collapse-current(3) (un)folds the current region.
Navigation via Item List
The Nim mode offers beside folding as well support for displaying an outline of the functions and classes, if the classes package is installed of the Nim file for easy navigation using the
item-list(3)
Abbreviations
The installation comes with a default abbreviation file for Nim file editing which can be used by writing short abbreviations like "fo" (for), "if", "ei" (else if) or "cl" (class) - and then pressing the key-binding for the
expand-abbrev-handle(3) command. The list of abbreviations can be used interactively in the GUI version of MicroEmacs using the
abbrev-list(3) command.
Working Environment
compile(3) may be invoked to rebuild the source, the user is prompted to save any files.
Short Cuts
The short cut keys used within the buffer are:-
C-c C-c - Comment out the current line.
C-c C-d - Uncomment the current line.
C-c C-e - Comment to the end of the line with hashes (#).
esc q - Format a comment.
esc o - Format a comment.
f2 - (Un)fold the current region.
C-f2 - (Un)fold all regions.
f6 - List items.
esc f6 - Close item list,
Executing, Formatting and Linting Nim code
The Nim file hook supports the
file-exec(3), the
file-format(3) and the
file-lint(3) macros. The default commands and tools are "nim compile --verbosity:0" for linting, "nim run --verbosity:0" for execting and the "nimpretty" application for formatting. The user can as well install the "nph" application for etter formatting on a Unix system using the nim package manager "nimble" like this:
nimble install nph
If the application "nph" is not available, the default "nimpretty" will be used instead.
NOTES
The hilighting or the addition of new item list matches is typically extended using a file mynim.emf. Support for classes can be added by adding the classes package using the nimble package manager like this:
nimble install classes
If the application "nph" is not available, the default "nimpretty" will be used instead.
SEE ALSO
(c) Copyright JASSPA 2025
Last Modified: 2025/10/12
Generated On: 2025/12/01