Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Set up your editor

Nifty files end in .nf. Any text editor can open them, but with editor support you get colors, errors as you type, and jumping to definitions.

All editor features come from nf lsp, a language server built into nf. Editors start it for you; you never run it by hand. So first make sure nf is installed and on your PATH (Install Nifty).

FeatureVS CodeZed
Syntax colors✓✓
Errors as you type✓✓
Autocomplete✓✓
Signature help and hover docs✓✓
Outline of your file✓✓
Go to definition✓✓
Find all references✓✓
Highlight the name under the cursor✓✓
Auto-indent, brackets, text objects✓

VS Code

The extension lives in editors/vscode. It isn’t on the Marketplace yet, so you run it from the source:

  1. Build it once:

    cd editors/vscode
    npm install
    npm run compile
    
  2. Open the editors/vscode folder in VS Code and press F5. A second VS Code window opens with Nifty support turned on. Open any .nf file there.

If nf isn’t on your PATH, set nifty.server.path in VS Code’s settings to the full path of the nf program.

After you rebuild nf, run the command Nifty: Restart Language Server from the command palette (⇧⌘P on macOS, Ctrl+Shift+P on Windows).

Zed

The extension lives in editors/zed.

  1. In Zed, open the command palette (⇧⌘P on macOS, Ctrl+Shift+P on Windows) and run zed: install dev extension.
  2. Pick the editors/zed folder.

If nf isn’t on your PATH, tell Zed where it is in settings.json:

{
  "lsp": {
    "nifty": {
      "binary": { "path": "/path/to/nf" }
    }
  }
}

After you rebuild nf, run editor: restart language server.

Other editors

Any editor that speaks the Language Server Protocol can use Nifty. Configure it to start the command nf lsp for files ending in .nf.

For syntax colors, there’s a Tree-sitter grammar (used by Zed, Neovim, Helix and others) and a TextMate grammar (used by VS Code, Sublime Text and others).