Skip to content

marcfbe/vscode-ofx-syntax-highlighter

Repository files navigation

OFX/QFX Syntax Highlighter

A VS Code extension that provides syntax highlighting and formatting for OFX/QFX (Open Financial Exchange) files (see specification).

If you like it, buy me a ☕ or 🍕 .

NO WARRANTIES, MIT License

Features

  • Syntax highlighting for OFX header section (key:value pairs)
  • Color-coded XML tags based on their function:
    • Group tags (e.g., OFX, BANKMSGSRSV1, STMTTRN) - Container elements
    • Value tags (e.g., ACCTID, NAME, MEMO) - Text content elements
    • Type tags (e.g., ACCTTYPE, TRNTYPE) - Type/enumeration elements
    • Date tags (e.g., DTPOSTED, DTSTART) - Date/time elements
    • Numeric tags (e.g., TRNAMT, BALAMT) - Numeric value elements
    • Vendor-specific tags (e.g., INTU.BID, INTU.USERID) - Vendor extension tags
    • XML standard tags (e.g., xml, xmlns, version) - Standard XML elements

Installation

From Source

  1. Clone this repository
  2. Open the folder in VS Code
  3. Press F5 to open a new Extension Development Host window
  4. Open an .ofx or .qfx file to see the syntax highlighting

Package Installation

  1. Install the extension from the VS Code marketplace (when published)
  2. Open any .ofx or .qfx file

File Format

OFX files consist of two sections:

  1. Header section:
    • Key-value pairs (e.g., OFXHEADER:100, VERSION:102) or
    • XML and OFX standard tags (e.g. <?xml ... ?>, <?OFX ... ?>)
  2. XML section: Structured XML data with OFX-specific tags

Supported File Extensions

  • .ofx - OFX files
  • .qfx - Quicken files (OFX variant)

Color Scheme

The extension uses different scopes for different tag types. The actual colors depend on your VS Code theme. To customize colors, you can add theme customizations to your settings.json:

{
  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": "entity.name.tag.group.ofx",
        "settings": {
          "foreground": "#569CD6"
        }
      },
      {
        "scope": "entity.name.tag.value.ofx",
        "settings": {
          "foreground": "#4EC9B0"
        }
      },
      {
        "scope": "entity.name.tag.type.ofx",
        "settings": {
          "foreground": "#C586C0"
        }
      },
      {
        "scope": "entity.name.tag.date.ofx",
        "settings": {
          "foreground": "#DCDCAA"
        }
      },
      {
        "scope": "entity.name.tag.numeric.ofx",
        "settings": {
          "foreground": "#CE9178"
        }
      },
      {
        "scope": "entity.name.tag.header.ofx",
        "settings": {
          "foreground": "#9CDCFE"
        }
      },
      {
        "scope": "entity.name.tag.vendor.ofx",
        "settings": {
          "foreground": "#FFA500"
        }
      }
    ]
  }
}

About

Made with ❤ in Canada

Copyright 2025 Marc Bernard

Follow @marcf.be on Blueksy and @marcfbe or LinkedIn

About

Syntax highlighting for OFX/QFX (Open Financial Exchange) files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Contributors