Skip to content
Fuse
Esc
↑↓navigate↵open⌘Jpreview
On this page

Editor setup

Syntax highlighting, completion, and inline validation for Fusefiles

A Fusefile is a YAML file named fuse.yaml, so every editor highlights it out of the box. What an editor does not know on its own is which JSON Schema applies, so you get no completion or inline validation for a Fusefile that lacks the modeline fuse init writes. Binding the schema to the filename fixes that.

What to bind

Pattern Matches
fuse.yaml the default file fuse up looks for in the current directory
fuse.yml the other name fuse up discovers
fuse.*.yaml variants like fuse.gpu.yaml or fuse.ci.yaml
*.fuse an explicit extension, if you prefer one

The CLI only discovers ./fuse.yaml and ./fuse.yml; the other two are naming conventions, and you point fuse up -f at them explicitly. A *.fuse file also needs a YAML file association, since its extension is not .yaml.

VS Code

Install the YAML extension, then add this to your user settings.json (or the workspace’s .vscode/settings.json, to set it for everyone on the repo):

{
  "files.associations": {
    "*.fuse": "yaml"
  },
  "yaml.schemas": {
    "https://raw.githubusercontent.com/folsomintel/fuse/main/schema/fusefile-v1.json": [
      "fuse.yaml",
      "fuse.yml",
      "fuse.*.yaml",
      "*.fuse"
    ]
  }
}

files.associations is only needed for *.fuse. yaml.schemas gets you completion, hover docs, and red squiggles on invalid fields, and it works even for Fusefiles that predate the modeline fuse init now writes.

Zed

Zed ships yaml-language-server, so both halves are one settings block. Add it to ~/.config/zed/settings.json, or to .zed/settings.json in the repo:

{
  "file_types": {
    "YAML": ["*.fuse"]
  },
  "lsp": {
    "yaml-language-server": {
      "settings": {
        "yaml": {
          "schemas": {
            "https://raw.githubusercontent.com/folsomintel/fuse/main/schema/fusefile-v1.json": [
              "fuse.yaml",
              "fuse.yml",
              "fuse.*.yaml",
              "*.fuse"
            ]
          }
        }
      }
    }
  }
}

Neovim

fuse.yaml is detected as YAML already. For *.fuse, add:

vim.filetype.add({
  extension = { fuse = "yaml" },
})

The modeline in a scaffolded Fusefile is enough for yamlls to pick up the schema. To bind the schema by filename instead, so it applies to Fusefiles without a modeline:

require("lspconfig").yamlls.setup({
  settings = {
    yaml = {
      schemas = {
        ["https://raw.githubusercontent.com/folsomintel/fuse/main/schema/fusefile-v1.json"] = {
          "fuse.yaml",
          "fuse.yml",
          "fuse.*.yaml",
          "*.fuse",
        },
      },
    },
  },
})

Vim

Only *.fuse needs a rule:

autocmd BufNewFile,BufRead *.fuse setfiletype yaml

Helix

fuse.yaml is detected already. For *.fuse, in ~/.config/helix/languages.toml (file-types replaces the built-in list rather than extending it, so keep yaml and yml):

[[language]]
name = "yaml"
file-types = ["yaml", "yml", "fuse"]

Helix uses yaml-language-server for YAML, so the modeline supplies the schema once the file is detected.

JetBrains IDEs

fuse.yaml is detected already. For *.fuse, add it under Settings → Editor → File Types → YAML. The bundled YAML support reads the modeline for schema validation.

Emacs

Only *.fuse needs a rule:

(add-to-list 'auto-mode-alist '("\\.fuse\\'" . yaml-mode))

Terminal

bat and GitHub highlight fuse.yaml without any config. For *.fuse, add this to ~/.config/bat/config:

--map-syntax "*.fuse:YAML"

and this to a .gitattributes in the repo:

*.fuse  linguist-language=YAML

Checking it worked

Open a Fusefile and confirm three things:

  1. Keys and strings are colored, and the file’s language shows as YAML.
  2. Typing res on a blank line offers resources.
  3. Changing version: 1 to version: 2 is flagged inline.

If highlighting works but completion does not, the language server is not running or the schema is not bound; if neither works, the file association did not take.

Was this page helpful?