Issue #125  (Patterns for Custom Labels)09/11/24

Advertisement
The Best New App for Newsletter Reading

Meco is a distraction-free space for reading newsletters outside the inbox. The app is packed with features designed to supercharge your learnings from your favourite writers.

Meco

Meco connects to Gmail & Outlook, is available to try free on iOS and desktop on the web, and has features like grouping newsletters, setting smart filters, bookmarking your favorites, and reading in a scrollable feed.

Join over 30k readers enjoying their newsletters and decluttering their inbox.

Try Meco Today →


In a previous issue, I discussed how you can customize the appearance of the labels on your currently open tabs. For example, you can choose a short, medium, or long label, so you can identify file name as well as path info. You can read about that in this archived issue.

Recently, VS Code improved on tab labels further by implementing custom labels using patterns that you define. Custom labels are on by default via the new Custom Labels: Enabled setting.
 
Custom Labels Settings in VS Code

In the full description for the Custom Labels: Patterns setting shown above, it explains in details the syntax requirements for the patterns as well as the available variables you can use. For example:
  • ${dirname} – Folder name 
  • ${dirname(N)} – "nth" parent folder name
  • ${filename} – Name of the file without file extension
  • ${extname} – File extension
  • ${extname(N)} – "nth" file extension
Here's an example where I'm setting all files in the main workspace using the pattern: ${filename} - ${dirname} (${extname})
 
Using Custom Labels in VS Code

With this in place, my tabs would look something like the following:
 
Custom Label Result in VS Code
 
If you're working on a single project where the file names are easy to identify by themselves, then you won't need to use this type of feature. But you can imagine how beneficial this could be if you have multiple files in a project that have the same name but are in different folders.

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

VS Code Tools

Convert Import Statements — A VS Code extension that allows you to easily convert 'require' statements to 'import' and vice versa.

ng-helper — A VS Code extension that serves as an assistant developing projects with Angular.js and TypeScript, with a number of HTML and component features for developing such apps.

Meco — Free your newsletters from the inbox. Move your newsletters to a space built for reading and declutter your inbox in seconds.    Sponsor 

TemPHPest — A VS Code extension to improve writing PHP code, with features like file stubs, auto-renaming, code actions, auto-interpolation, and more.


VS Code Theme of the Week

UV — Described as a "glow-in-the-dark" theme for VS Code that's inspired by black lights, this is certainly one of the more unusual themes I've come across and I couldn't resist sharing it here.
 
UV Theme for VS Code

The version of the theme shown above is the only one in the package and it's pretty wild! Although it looks abrasive at first, it does have nice contrast in the syntax highlighting.

VS Code Articles

VS Code 1.93 (August 2024 Updates) — The latest updates to VS Code include a profiles editor, IntelliSense on vsocode.dev, resizing columns with the keyboard, and lots more.

Chinese APT Abuses VS Code to Target Government in Asia — According to the article, "This threat actor used Visual Studio Code’s embedded reverse shell feature to gain a foothold in target networks ... According to our telemetry, this is the first time a threat actor used it in the wild."

The Morning Paper for Tech — Want a byte-sized version of Hacker News that takes just a few minutes to read? Try TLDR's free daily newsletter. It covers the most interesting tech, startup, and programming stories in just 5 minutes. No sports and no politics.  Sponsor 

Coding on iPad using VS Code, Caddy, and code-server — One developer's instructions on how you can install VS Code on a server and access it from anywhere including your tablet.

Best of the Rest

Pragtical — A pragmatic code editor, forked from Lite X, written mostly in Lua with a focus on been practical rather than minimalist.

Server Mono — A monospace typeface inspired by typewriters, Apple's San Francisco Mono, ASCII art, command-line interfaces, and programming tools.

Bytes — An informative and entertaining newsletter for JavaScript engineers of all levels, with the latest news, articles, tools, and tips so you can successful keep up with the latest in the world of JavaScript.  Sponsor 

Zed Extensions — A central repository containing the extensions available for Zed, the next-generation code editor designed for high-performance collaboration with humans and AI.

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.