Issue #37  (Language Specific Settings)01/04/23

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

A really powerful way to customize your settings in VS Code is by means of language-specific settings. This feature allows you to use different settings depending on the programming language (or file type) you're coding in.

For example, you might want to use 4 spaces for indenting your PHP, Python, or another back-end language; but when you're working in JavaScript or CSS, you might prefer 2 spaces. You might also have some different preferences for something like Markdown or HTML, since they're quite different from those other languages.

Let's use PHP and CSS to demonstrate. In the Settings UI, you'll notice there's a little filter button in the top-right area of the editor, next to the search box. If you click this button, you'll see a "Language..." option.
 
Language specific settings in VS Code
 
If you choose that option, the search field will be populated with "@lang:", followed by some language options to choose from in a dropdown. If you select PHP, you'll be presented with what looks like a regular list of settings. But these will be applied only when you're coding in PHP.

As a side point here, technically you don't have to use the "filter" option, you can simply type @lang: into the search box, followed by the language in which you want to namespace your settings.
 
Language specific settings in VS Code

Once the language namespace is defined in the search box, you can scroll down to start changing settings for that language, or type a keyword to look for a specific setting. Once you've changed a few settings for a particular language, you can see all your new language-specific settings in your settings JSON file.
 
Language specific settings in JSON in VS Code

Notice in my example, I have two settings for CSS and two for PHP. What you see in that screenshot is the JSON syntax for any language specific settings, assuming you want to edit directly in the JSON this way, rather than using the Settings UI.

If you want to go directly to the JSON file with the language ready to be used, you can open your command palette and type "Preferences: Configure Language Specific Settings". From there, you'll get a dropdown list of language options. When you choose a language, you'll be taken immediately to your default settings editor (UI or JSON, depending on what you have as your workbench.settings.editor value). Usefully, the JSON editor provides all the possible options via a dropdown, if you want to go the JSON route.

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

VS Code Tools

VSCode Neovim — VS Code extension that uses a fully embedded Neovim instance that uses VSCode's native functionality for insert mode and editor commands, making the best use of both editors.

Blink Code — VS Code integration for Blink Shell, the terminal app for iOS devices.

ChatGPT VSCode — I featured another ChatGPT extension last week. This one lets you perform queries, add tests, code analysis, refactor, explain code, and more.

XState VSCode — VS Code extension that enhances the XState development experience by providing VSCode users with features like visual editing, autocomplete, typegen, and linting.

 

VS Code Articles

Visual Studio Code Cheat Sheet — From the folks that build Tower, the popular Git client, this is a nicely designed cheat sheet that's part of a larger group of cheat sheets you can sign up for.

How to Change the Default Terminal in VS Code — The author's examples switches the terminal from PowerShell to GitBash.

My VS Code Workflow For Ruby Programming On Metasploit — Ruby coder Grant Wilcox goes through an extensive set of plugins and tips for setting up VS Code to work similarly to RubyMine, the JetBrains IDE for Ruby programmers.

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

10 Best WebStorm Themes — David Watson of the JetBrains team goes through some of his team's favourite themes for customizing WebStorm.

Slashbase — An in-browser collaborative database IDE that enables you to browse and manage databases, write and run, and share queries with your team, right from your browser.

kickstart.nvim — A launch point for your personal Neovim configuration that's small, documented, and modular.


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.