Configure VSCode for maximum productivity
I've been using VSCode for data science work for years now, and it's become my go-to editor. What I love about it is that it's free, incredibly powerful, and strikes the perfect balance between simplicity and functionality. Let me share the configuration tweaks and extensions that have made the biggest difference in my day-to-day work.
How do I access VSCode settings?
You've got two ways to get at the settings, and honestly, which one you use depends on your comfort level:
- GUI method: Hit
⌃/⌘ + ,
(comma) to open the friendly settings interface - JSON method:
⌃/⌘ + Shift + P
→ "Preferences: Open Settings (JSON)" for direct access to the configuration file
I'm a JSON method person myself because it gives me more control and I can version control my settings. Plus, once you get used to it, it's actually faster than clicking through menus.
What built-in settings have transformed my workflow?
Auto-save - because losing work is the worst
This one setting has probably saved me more frustration than any other:
{
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 10
}
I set it to save after just 10ms of inactivity. Now I never have to worry about losing work when my laptop crashes or I accidentally close a tab. The only time you might not want this is if you're running a live development server that reloads on every save - but for data science work, it's pure gold.
Format on save - my personal code stylist
{
"editor.formatOnSave": true,
"editor.formatOnPaste": true
}
This is like having a tireless assistant that constantly cleans up your code. When I save a file, black automatically formats it. When I paste code from somewhere else, it gets formatted to match my style. You'll love the magic, I guarantee it!
File cleanup - keeping things terminal-friendly
{
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true
}
These two settings keep my files clean:
insertFinalNewline
adds a newline at the end of every file (Unix convention) - makes viewing them in the terminal much cleanertrimTrailingWhitespace
removes those annoying trailing spaces that can cause git diff noise
Visual improvements that actually matter
{
"editor.lineNumbers": "on",
"editor.renderWhitespace": "boundary",
"editor.rulers": [79, 88],
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 88
}
I've got rulers at 79 and 88 characters because they help me stay within reasonable line lengths. The 88-character limit works perfectly with black's default formatting, and 79 is the traditional Python recommendation.
Terminal integration that doesn't let me down
{
"terminal.integrated.scrollback": 10000,
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.shell.linux": "/bin/bash"
}
At 10,000 lines, this gives me a scrollback buffer that actually lets me find what I was doing five minutes ago. Trust me, you'll appreciate this when you're debugging a long-running script.
What extensions have actually improved my productivity?
Python + Pylance - the dynamic duo
The official Python extension is where the magic happens. It gives me syntax highlighting, IntelliSense, debugging, automatic imports, and integration with linters and formatters. When I install a new Python version or activate a different environment, VSCode picks it up automatically.
The real game-changer, though, is adding Pylance on top. This extension uses Microsoft's super-fast type checker to highlight problems in my code within milliseconds of saving. When I'm doing tool development as part of my data science work, Pylance catches so many issues before they become runtime errors.
Code quality that runs itself
markdownlint
Since I write a lot of documentation (like this book!), markdownlint has been invaluable. It catches formatting inconsistencies in my Markdown files - things like headers with punctuation or missing line breaks. It's based on the Node.js markdownlint package by David Anson, and it keeps my writing consistent.
Markdown Table Prettifier
This one was suggested by my book reviewer Simon Eng, and I'm so glad he did! It formats Markdown tables so they're actually readable in plain text mode. No more trying to count characters to make columns line up.
Visual enhancements that solve real problems
Peacock - because I have too many projects open
Remember how I advocate for the one-to-one rule in project management? Well, when you follow that rule, you end up with multiple VSCode windows open, one for each project. Peacock lets me color-code each window, so I can instantly tell which project I'm working on. No more accidentally editing the wrong file!
Rainbow CSV - making data files readable
Simon Eng suggested this one too, and it's been a lifesaver when I need to quickly examine CSV files. Instead of squinting at plain text, I get color-coded columns that make the data structure immediately obvious.
Productivity tools that actually boost productivity
Polacode - beautiful code screenshots
This is my "polaroid for code" tool. If you've ever used carbon.now.sh, you'll love having this capability built into your editor. Perfect for creating screenshots to share with colleagues or include in documentation.
Remote development - working from anywhere
Remote - SSH
This extension gives me superpowers. I can edit code on a remote server while keeping all the goodness of my local VSCode setup. This is fantastic when I'm working on a power-sipping laptop but need access to a beefy compute server. It beats mounting remote file shares by a mile - the latency difference is night and day.
The VSCode Remote Development extension pack takes this even further, giving me a complete remote development environment that feels completely local.
What keyboard shortcuts do I actually use?
I'm not going to overwhelm you with every possible shortcut, but these are the ones I reach for constantly:
Shortcut | What it does | Why I love it |
---|---|---|
⌘ + P |
Quick file open | Jump to any file instantly |
⌘ + ⇧ + P |
Command palette | Access any VSCode function |
⌘ + / |
Toggle line comment | Comment/uncomment code quickly |
⇧ + ⌥ + F |
Format document | Clean up messy code instantly |
⌘ + ⇧ + F |
Search across workspace | Instantly find anything in your project |
⌘ + ⇧ + E |
Focus file explorer | Quickly jump back to the file browser |
⌘ + B |
Toggle left sidebar | Show/hide file explorer and sidebar tools |
⌘ + ⌥ + B |
Toggle right sidebar | Show/hide chat panels (Cursor, Copilot, etc.) |
F12 |
Go to definition | Navigate code like a pro |
How do I handle project-specific settings?
Sometimes different projects need different configurations. I create a .vscode/settings.json
file in the project root for these cases:
{
"python.defaultInterpreterPath": "./venv/bin/python",
"python.linting.pylintArgs": ["--rcfile=.pylintrc"],
"files.associations": {
"*.yaml": "yaml",
"*.yml": "yaml"
}
}
This lets me have project-specific Python interpreters or linting configurations while keeping my global defaults intact. It's particularly useful when I'm working on projects with different Python versions or coding standards.
What about collaborative coding?
If you're doing pair programming, VSCode Live Share is absolutely fantastic. It lets someone else edit in my VSCode session with minimal latency. It's so much better than screen sharing or remote desktop - your colleague gets the full VSCode experience, including their own cursor and selections.
Remember: start simple, grow gradually
Don't try to implement everything at once. Start with the basic settings that solve your immediate pain points - probably auto-save and format-on-save if you're just getting started. Then add extensions as you discover specific needs.
The beauty of VSCode is that it grows with you. What starts as a simple text editor can evolve into a full-fledged development environment tailored exactly to your workflow. Just don't let the configuration become more work than the actual coding!