Issue #98  (Read-only Files and Folders)03/06/24

Advertisement
Techpresso: Get Smarter About AI and Tech in 5 mins

Receive a daily summary of the most important AI and Tech news, carefully selected from 60+ media outlets.

Techpresso

Also includes a good dose of tech tools and programming-related apps and resources. Join 30,000+ professionals from OpenAI, Meta, Google, Microsoft, Hugging Face, JP Morgan, and more.


There are specific circumstances where you may want to ensure that a file or possibly an entire folder should not be edited. For example, the node_modules folder is not something you would normally want to go in and make edits to, as that's managed by the npm service.

VS Code allows you to mark any folder, file, or set of files using a glob pattern, as read-only. Search for the setting "files.readonly" and you'll see a few settings options appear.
 
Read-only settings in VS Code

The Readonly Include setting is the main one you'll use for this. This setting allows you to add a pattern where the folders/files that get matched will be 'included' in the set of files marked as read-only.

The Readonly Exclude option can be used in conjunction with the Readonly Include setting. For example, you might include the entire contents of a folder using Readonly Include, but then you might want to exclude a single file from that folder from becoming read-only.
 
Seting Read-only Exceptions in VS Code

In the example above, I'm setting all files inside an "includes" folder as read-only, but I've made a single exception using the "Excludes" option.

When I open these files in my file explorer, I can see the lock icon indicating that certain files in the folder are in fact read-only.
 
Trying to Edit Read-only files in VS Code

As shown above, I can also see an indication in the tab for the read-only files and a message will appear in a tooltip if I try to edit a read-only file.

And as a side point, if you're not familiar with how glob patterns work, you can check out this page on the VS Code docs.

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

VS Code Tools

Actionforge — VS Code extension for executing Action Graphs, a faster, easier way to visually create and execute GitHub Action workflows in minutes, not hours, with no YAML required.

Mermaid Editor — VS Code extension for Mermaid.js, the popular JavaScript charting and diagramming tool, allowing you to live edit mermaid.js diagram files, copy images to the clipboard, generate PNG, JPEG, WebP, and SVG diagram files, and more.

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 

vscode-sqlite — Popular VS Code extension for SQLite that allows you to explore and query SQLite databases, export databases to various formats, and includes autocomplete for SQLite keywords, table/views names, column names, etc.


VS Code Theme of the Week

Blinds Theme — This pair of themes is described as "colorblind (deuteranopia) friendly," designed for increased readability and productivity, and includes a dark and light version.

Blinds Theme for VS Code

This is probably one of the few themes where I personally might prefer the light version over the dark one. I've included the dark version above so you can see the color choices for the syntax highlighting. I'm not crazy about the colors, but if you're looking for something that's helpful for colorblindness, this is one option.

VS Code Articles & Videos

VS Code 1.87 (February 2024 Updates) — The latest updates to VS Code include voice dictation in the editor, multi-cursor inline suggestions, rename suggestions from Copilot, sticky scroll enabled by default, and more.

Navigating VS Code Addons for Beginners — Primarily a beginner's article, but there's a lot of detailed info here (mostly the second half) that might even be helpful for more experienced VS Code users.

How to Use VS Code as Your Python IDE — A fairly comprehensive guide for those switching from another IDE for Python development, or for those just getting started with Python in VS Code.
 

Best of the Rest

typescript-eslint Playground — A live playground for typescript-eslint, tooling that enables TypeScript support in ESLint and Prettier.

3 Vim Commands for Blazingly Fast Navigation Between Brackets — Useful keyboard tips and explanation for those using Vim and wanting to improve navigation in a codebase.

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

CodeSnap — An image editor to share beautiful images of your code. Includes themes and requires upgrading to Premium to use unlimited features.

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.