Issue #38  (Default Language and File Associations)01/11/23

Advertisement
Get a weekly dose of tools, articles, and other resources covering remote work, productivity, career well-being, and lots more.

VS Code allows you to make a few language and file-specific changes to suit your needs, depending on the kinds of languages you work with.

First of all, opening a new file in VS Code defaults the file's "language" to "plain text". You can see the current language (or syntax) in the bottom right area of the status bar in your editor.
 
Default Language for new files in VS Code
 
You can click it to change the language of the current file, but it's more than likely that you don't want this to default to plain text. To change the default language for a new file, search for "defaultLanguage" in your settings.

This brings up the "Files: Default Language" setting, which you can change by typing in the name of the language you want as the default. The name, with some exceptions, should be typed in all lowercase and is generally the same as the name itself (e.g. "Python" is "python", "JavaScript" is "javascript", etc). The VS Code docs have a full reference here.
 
Changeing the Default Language in VS Code

With this in place, all new files will automatically use syntax highlighting for the default language you select, and saving the file will default to that language's file extension.
 
Associating Files with Languages in VS Code

You can also look for the setting "files.Associations", which allows you to associate languages with file extensions. This might be useful if you're using noncustomary file extensions for different files. The VS Code docs include an example using .php4 and .php5 file extensions. This way you can instruct VS Code what to do with those files since it won't naturally associate those file extensions with PHP. You can change this in the UI settings and it will look as shown in the screenshot above in your JSON settings.

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

VS Code Tools

VSCode Stats — This is a dashboard that tracks how VS Code development is progressing, showing some general stats (overall open/closed issues, PRs, etc.) along with some visuals on progress over the past few weeks.

Bito AI — AI assistant for VS Code that makes it easy to write code, understand syntax, write test cases, explain code, comment code, check security, and explain high-level concepts.

Regex Previewer — A regex matches previewer for JavaScript, TypeScript, PHP, and Haxe inside VS Code.

One Dark Pro — Atom‘s iconic One Dark theme for VS Code, which might be useful to those switching from the now-defunct Atom in favour of VS Code.
 

VS Code Articles & Videos

A First Look at the New GitLab Web IDE and Remote Development Experience — Not exactly a VS Code article, but this is actually a post from the GitLab team announcing their new web IDE, which will now be built on top of the open-source VS Code project.

Work in Microsoft Azure with Visual Studio Code — Timothy Warner takes a look at how you can make your Microsoft Azure work easier by moving from Windows PowerShell ISE to VS Code.

▶ TypeScript Crash Course with Matt Pocock — A one-hour live stream from a few months ago on the VS Code YouTube channel, with an introduction to TypeScript, useful for those who've wanted to get into TypeScript but haven't yet.

Let Me Guess: Your Portfolio is Down? — Same here. The S&P is down, NASDAQ is down, crypto is down. But did you know that comic books are way up? Or that vinyl records are mooning? That's why you should read Alts. They analyze alternative assets, and you reap the rewards.  Sponsor 
 

Best of the Rest

10x Editor — A lightweight and responsive code editor that understands C++ out-of-the-box and performs well with the largest of codebases.

Salesforce Code Builder — A web-based IDE that has all the power and flexibility of VS Code, Salesforce Extensions for VS Code, and Salesforce CLI in your web browser.

Vim Prank: alias vim='vim -y' — A little trick you can play on a Vim user with Vim's 'easy mode' flag, which many find to be a useful feature regardless of the prank described here. There's also some follow-up discussion that the author links to on Hacker News.


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.