Vercel Snippets is a free Sublime Text package with 140 Vercel snippets. They cover the things you type again and again on a Vercel project: vercel.json rules, CLI commands, Serverless and Edge functions, Next.js patterns, storage clients and deployment workflows. You type vc:, pick a pattern, and press Tab.
This is an unofficial community package. It is not affiliated with Vercel Inc.
The 140 Vercel snippets by category
| Prefix | Category | Snippets |
|---|---|---|
vc:json: |
vercel.json configuration | 28 |
vc:cli: |
CLI commands | 22 |
vc:fn: |
Serverless and Edge functions | 20 |
vc:next: |
Next.js patterns on Vercel | 30 |
vc:env: |
Environment and configuration | 10 |
vc:store: |
Storage: Redis, Postgres and Blob | 10 |
vc:ai: |
AI SDK | 5 |
vc:deploy: |
Deployment and CI | 15 |
A few examples
| Type this | You get |
|---|---|
vc:json:init |
A minimal vercel.json to start from |
vc:json:headers:security |
Security headers: CSP, HSTS and X-Frame |
vc:json:cron |
A cron job entry |
vc:json:functions |
Function settings such as memory and maximum duration |
vc:fn:cors |
A CORS headers helper for a function |
vc:next:cache |
A fetch call with cache and revalidate options |
vc:env:dotenv |
A .env.local template |
vc:store:redis:init |
An Upstash Redis client |
vc:store:postgres:drizzle |
Neon Postgres with Drizzle ORM |
vc:store:blob:upload |
A Vercel Blob upload |
How to use them
- Type
vc:in Sublime Text. The autocomplete menu lists the snippets. - Keep typing to narrow the list. For example,
vc:json:shows only thevercel.jsonpatterns. - Press Tab to expand the one you want.
Install it
- Open the Command Palette:
Cmd+Shift+Pon a Mac,Ctrl+Shift+Pon Windows and Linux. - Choose Package Control: Install Package.
- Search for Vercel Snippets and press Enter.
To install by hand, clone the GitHub repository into your Sublime Text Packages folder.
Common questions
Which Sublime Text versions does it support?
Sublime Text 3 and 4.
Is this an official Vercel package?
No. It is a community package and is not affiliated with Vercel Inc.
Does it cover Next.js?
Yes. Thirty of the snippets are Next.js patterns for projects hosted on Vercel, such as cached fetch calls, redirects in server components, and reading headers and cookies.
Which storage services are covered?
Upstash Redis, Neon Postgres (including a Drizzle ORM setup) and Vercel Blob.
Is it free?
Yes. It is open source under the MIT license.
Related
For WooCommerce work, see WooCommerce Snippets for Sublime Text. The rest of my work is on the open source contributions page.