How to dictate in VS Code and other code editors
By the Dictr team ·
Voice works well for the parts of programming that are plain language: comments, commit messages, documentation, code review and prompts to a coding assistant. Here is what to dictate, what to keep typing, and how to set it up in any editor.
What voice is good for in an editor
- Comments and docstrings: you already know what the function does, so say it.
- Commit messages and pull request descriptions: a spoken summary is usually clearer than a typed one-liner.
- README files, design notes and tickets.
- Code review comments.
- Prompts to a coding assistant, where a few spoken sentences of context get a better answer than a short typed line.
- Messages to your team about the code.
What to keep typing
Code itself is mostly symbols, exact names and indentation. Saying "open brace, new line, tab" is slower than typing it, and speech recognition was built for sentences, not for camelCase. Type the code and let your editor complete it; speak the language around it.
Short exact strings (a variable name, a path, a version number) are also faster typed.
Setting it up
You do not need an editor extension. A dictation app that types at the cursor, the way a keyboard does, works in VS Code, Cursor, JetBrains editors, Vim in a terminal, and the browser, with nothing to install in each.
- Install a dictation app that types into any window.
- Put the cursor where the text should go: a comment line, the commit box, the chat panel.
- Hold the key, speak, let go.
- Read the text before you commit or send it.
With Dictr you hold Ctrl + Win on Windows or Ctrl + Super on Linux, speak, and let go. It runs on Windows (Windows 10 and 11, 64-bit) and Linux (x86_64, as an AppImage or Debian and Ubuntu (.deb)). A Mac app is on the way.
Teaching it your words
Project names, library names and acronyms are the words speech recognition gets wrong, because it has never heard them. Most dictation apps let you add your own words so they are spelled your way.
In Dictr this is the list of your own words and names, part of Personal. Add the names of your services, teammates and tools once.
Habits that make it work
- Say the whole thought, then stop. One hold of the key per paragraph.
- Speak the way you would explain it to a teammate. Plain sentences make good comments.
- In an open office, a headset keeps your voice low and the text accurate.
- Keep the keyboard for editing. Voice for the first draft, keys for the fixes.
Hold a key, speak, and your words are typed in any app. 2,000 words free every week, no card.
Download DictrMore guides
- Voice typing on Windows 11: how to turn it on and get clean text
- Dictation on Linux: type with your voice on Ubuntu, Fedora and more
- How to dictate email and documents that read well
- Is speaking faster than typing? What the studies found
- Typing by voice when your hands or wrists hurt
- Voice typing for students and writers: getting a first draft down
- Speech to text in more than one language: what works
- How to choose a dictation app: seven things to check