Issue #57  (VS Code CLI)05/24/23

Advertisement
Meco: An Inbox Designed for Reading NewslettersEnjoy your newsletters in a space built for mindful reading while giving your inbox space to breathe. It's easy to get set up and completely free!

When you install VS Code on your machine, you can access VS Code's built in CLI through any terminal you open locally. For example, on my Windows machine I can open either my default Windows Command Prompt or Git Bash and have access to VS Code's CLI.

In the screenshot below, I'm in the Windows Command Prompt checking the version of VS Code installed, using the command code --version:

Using the VS Code CLI

You can see the full range of commands available by typing code --help. The list of commands is also available in the VS Code docs, as shown below.
 
VS Code CLI Options

One common command you might want to know is the one to launch VS Code from your terminal. You can do this using the command code . (that is the word "code" followed by a space then a dot). This will open the current folder in VS Code.

If you've installed VS Code Insiders on your system (which is like the "Chrome Canary" of VS Code), you can launch it using code-insiders . as the command (again with a dot following a space).

You can also use a command like code index.html style.css to open a specific set of files in the instance of VS Code that will launch. If the files don't exist, they will be created. If you use multiple folder names, VS Code will open a Multi-root Workspace where multiple projects are opened at the same time.

The basic command to open VS Code will open a new window each time the command is used. If you want to open the current folder in the previously active VS Code instance, you can use the --reuse-window argument (or flag). There's even an argument called --goto that allows you to open a file at a specified line number!

So if you often work in the terminal outside of VS Code, some of these commands might help when switching back to the editor in a specific context.

Now on to this week's hand-picked links!
 

VS Code Tools

Commit Message Formatter — A VS Code extension that formats your commit messages using best practices for the title and body of the commit message.

Horizon Theme — A beautifully warm dual theme for VS Code that uses some nice oranges, reds, browns, etc.

Polyglot Notebooks — A VS Code extension powered by .NET Interactive,, that brings support for multi-language notebooks to VS Code.

Bytes: Your Favourite JavaScript Newsletter — I subscribe to a lot of newsletters, but this is definitely one I look forward to. Entertaining with lots of cool and useful JavaScript coding tidbits, news, and tools. Sponsor

reTypewriter — A VS Code extension that allows you to 'record' and 'replay' changes made to files, to simulate typing.
 

VS Code Articles & Videos

▶ Level Up Your VS Code Workflow: Start Using Profiles — Zoran Jambor covers a short guide to VS Code profiles where he covers what are the practical use cases for them, how they work, how to share them, and more.

Best IDEs and Code Editors for Python — Not specifically a VS Code article, but it does cover VS Code along with 8 other IDEs.

Tower Makes Git Easy — Just ask the 100,000 developers using it around the world. A native Git client with Undo, Drag & Drop and Remote Services Integration so that you can build better software!  Sponsor

Debugging TypeScript Projects with VS Code — Goes through steps for those working with Node.js and TypeScript along with the ts-node-dev package and some config in VS Code.

Best of the Rest

chatgpt-shell — ChatGPT and DALL-E Emacs shells + Org Babel. Includes shell-maker, a way to create shells for any service.

WordPress Playground — An experimental project from the WordPress team that allows you to test out WordPress running entirely in the browser.

docswrite.com — A free online tool to convert any public Google Doc to Markdown in a single click.


Suggestions?

If you have any link suggestions, including a tool, article, or other resources related to VS Code or another IDE, send it via DM on X: @LouisLazaris or just hit reply on this email.

That's it for this issue.

Happy VS Coding!
Louis
VSCode.Email
@LouisLazaris
Copyright © VSCode.Email. All rights reserved.

Not affiliated with Microsoft, Visual Studio Code, or any of its trademarks.