VSCode Extension
The official hitspec VSCode extension (v0.2.0) provides syntax highlighting, snippets, and language configuration for.http and .hitspec files.
Features
- Full syntax highlighting via TextMate grammar
- 46 code snippets covering requests, assertions, captures, annotations, blocks, and built-in functions
- Comment toggling (
#) - Bracket matching and auto-closing for
{},[],(),"",'',{{}}, and>>>/<<< - Code folding for request separators (
###) and assertion blocks
Syntax Highlighting
The TextMate grammar highlights these elements:- HTTP methods — GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE, CONNECT, WS
- Request separators —
###lines - Annotations —
@name,@tags,@auth,@depends,@if,@unless,@import,@stress.*,@contract.*, and others - Headers — key-value pairs like
Content-Type: application/json - Assertion blocks (
>>>/<<<) —expectkeyword, comparison operators (==,!=,>,<,>=,<=), matchers (contains,matches,exists,type,schema,snapshot, etc.), and subjects (status,body,header,duration) - Typed blocks —
>>>capture,>>>graphql,>>>db,>>>shell,>>>multipart,>>>variables - Variable interpolation —
{{variable}} - Built-in functions —
$uuid(),$timestamp(),$env(),$random(), and others - File includes —
< ./path/to/file - Query parameters —
? key = valueand& key = value - Strings, numbers, booleans, null
Installation
The extension is declarative-only — no IntelliSense or autocomplete beyond snippets. The REST Client extension is an alternative for basic
.http support, but it does not highlight assertion blocks, typed blocks, or annotations.Neovim
The hitspec Neovim plugin provides syntax highlighting, filetype detection, buffer settings, and optional LuaSnip snippets for.http and .hitspec files.
Features
- Syntax highlighting via Vim syntax file (not TreeSitter)
- Filetype detection for
.httpand.hitspec - Buffer settings:
commentstring(# %s), 2-space indentation - 57 LuaSnip snippets (optional) covering HTTP methods, assertion/capture blocks, annotations, built-in functions, and a complete request template
Installation
- lazy.nvim
- Manual