https://github.com/foxoman/zed-nim
Nim support for Zed Editor
https://github.com/foxoman/zed-nim
nim nim-lang zed-editor zed-extension
Last synced: 8 months ago
JSON representation
Nim support for Zed Editor
- Host: GitHub
- URL: https://github.com/foxoman/zed-nim
- Owner: foxoman
- License: apache-2.0
- Created: 2024-07-12T08:06:46.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-15T14:31:01.000Z (9 months ago)
- Last Synced: 2025-03-23T18:46:45.228Z (9 months ago)
- Topics: nim, nim-lang, zed-editor, zed-extension
- Language: Scheme
- Homepage:
- Size: 78.1 KB
- Stars: 22
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Zed Nim
Nim extension for Zed Editor

### Features
* Syntax highlighting
* Code completion
* Runnable buttons
* Inlay hints
* Tasks
* Diagnostics
* Go to definition and references
* Hover
* Outline
* Code actions (restart nimsuggest)
## Install
### Prerequisites
By default this extension uses [nimlangserver](https://github.com/nim-lang/langserver). Alternatively you can configure it to use [nimlsp](https://github.com/PMunch/nimlsp) (see below), though support for it is limited. Make sure to install one of the language servers.
### Editor
Nim support has been officially integrated into the Zed editor through this extension. To enable it, search for "Nim" in the Zed extensions and install it.

### Dev / Manual install
Download the source and follow the instructions in the [Zed documentation](https://zed.dev/docs/extensions/developing-extensions#developing-an-extension-locally).
## Configuration
### LSP Parameters
To change settings of the nimlangserver add the following to your settings. List of options can be found in nimlangserver's [description](https://github.com/nim-lang/langserver?tab=readme-ov-file#configuration-options).
```json
"lsp": {
"nim": {
"settings": {
// Add your settings here:
"timeout": 10000,
"projectMapping": [
{
"projectFile": "tests/all\\.nim",
"fileRegex": "tests/.*\\.nim"
}
],
"maxNimsuggestProcesses": 1,
"notificationVerbosity": "warning"
}
}
}
```
### Switching LSPs
Zed allows to specify the binary to use as a language server (such as nimlsp):
```json
"lsp": {
"nim": {
"binary": {
"path": "/your/path/to/.nimble/bin/nimlsp",
"args": []
},
...
}
}
```
### Formatting
To use [nph](https://github.com/arnetheduck/nph) as a formatter, add this to your settings:
```json
"languages": {
"Nim": {
"formatter": {
"external": {
"command": "nph",
"arguments": ["-"]
}
}
}
}
```
### Jupyter
Zed provides support for [notebooks as scripts](https://zed.dev/docs/repl). To use [jupyternim](https://github.com/stisa/jupyternim) as a kernel, add it in your settings:
```json
"jupyter": {
"kernel_selections": {
"nim": "jupyternimspec"
}
}
```
## Screenshots
|
|
|
|:---:|:---:|
| Diagnostics | Inlay Hints |
|
|
|
|:---:|:---:|
| Tasks | Runnables |