A lightweight VS Code extension providing editor support for CheatMD cheatsheets. Write executable Markdown documents with completion, linting, and syntax highlighting.
-
Syntax Highlighting:
- Full syntax highlighting inside HTML comments
<!-- cheat...-->blocks. - Highlights variable declarations (
var), imports (import), exports (export), conditionals (if/fi), and chains (chain). - Scopes command snippets inside variable definitions with
source.shelltoken styling. - Highlights variable references (
$nameand<name>) within Markdown fenced code blocks (e.g. bash, sh, powershell).
- Full syntax highlighting inside HTML comments
-
CodeLens Execution:
- Adds a
Run with CheatMDCodeLens above Markdown code fences under headings. - Runs
cheatmd --headlessand shows command output in the CheatMD output channel. - Prompts for CheatMD variables through VS Code input controls.
- Adds a
-
Linting Diagnostics:
- Automatically runs
cheatmd --lintin the background on file open and save. - Highlights syntax errors, duplicate exports, missing variables, unresolved imports, and chain warnings with precise editor squigglies.
- Reports diagnostics in the VS Code Problems tab.
- Automatically runs
-
Autocompletion:
- Suggests DSL keywords (
var,import,export,chain,if,fi) when starting a line in the DSL block. - Auto-scans your workspace to suggest all available exported modules when completing
import. - Suggests selector options (
--header,--column,--select-column,--map,--delimiter,--multi) when typing selector options after---. - Suggests all variables (locally declared and imported) when typing
$or<inside code blocks.
- Suggests DSL keywords (
CheatMD for VS Code requires the cheatmd command-line tool for linting and CodeLens execution.
- Website: https://cheatmd.dev
- GitHub: https://github.com/cheatmd-dev/cheatmd
After installing, make sure cheatmd is available in your system path. You can also set an absolute path in the extension settings.
CheatMD for VS Code starts the local cheatmd binary for linting and inline execution. It passes the current workspace path to that local command. The extension does not send telemetry, show ads, require an account, or make network requests.
The extension adds the following settings under File > Preferences > Settings > Extensions > CheatMD:
cheatmd.linter.enable: Enable/disable background linting (default:true).cheatmd.linter.executablePath: Specify custom path to yourcheatmdexecutable (default:"cheatmd").cheatmd.linter.strict: Treat all warnings as errors (default:false).
To install the packaged .vsix extension:
- Open VS Code.
- Open the Extensions sidebar (
Ctrl+Shift+X). - Click the
...menu in the upper-right corner of the Extensions panel. - Select Install from VSIX... and choose the packaged
cheatmd-0.1.0.vsixfile.