Michael Clark

My Favorite Settings in VSCodium

Here are a few of my favorite settings in VSCodium that I cannot live without. These are the first settings I configure when I set up VSCodium or VSCode.

What is VSCodium?

Microsoft's VSCode is one of the most popular text editors used by software developers. VSCodium is created from the open source binary provided by Microsoft that removes all tracking and telemetry, which leaves a lightweight and highly extensible text editor.

Insert Final Newline

This setting adds a final new line to a file when you save. The POSIX standard requires every file to end with a newline character. Without it, some programs can't parse the last line of your file properly, leading to unexpected behavior.

I write a lot of SQL files, and to debug them I typically use the cat command to concatenate several SQL files together into one big file. If the files don't end with a newline character, it produces syntax errors that I manually fix. When making a GitHub pull request, the files changed will have a notification reminding you to add a newline character to the end of your file.

Trim Final Newlines

This setting will clean up any additional empty newlines at the end of your file when you save. Combined with Insert Final Newline, this setting will ensure that you only have a single newline character at the end of your file. This mostly reduces clutter and doesn't have any practical benefits besides keeping your files neat and tidy.

Trim Trailing Whitespace

If you've made it this far down the list, you can probably tell I am particular about whitespace. This setting removes whitespace characters like spaces and tabs at the end of files when you save. It's frustrating to edit a line and discover there's trailing spaces lurking at the end. I like to keep my files nice and clean, so this setting is always on.

Render Whitespace: all

Blank space could be multiple spaces or a tab. Without setting Render Whitespace to all, you'll struggle to tell the difference. With this setting set to all, spaces will show up as a dim dot character and tabs will display as a faint arrow character. You can count the dots to see how many spaces are in an indentation and can make errors easier to spot. This is important when you're editing a Makefile, since a Make target needs a tab character and won't run when there is a space.

Git Blame Editor Decoration: Enabled

I previously installed an entire extension for this, but realized the only feature I used was to show the git blame and history inline in the editor. With this setting enabled, I removed my dependency on a third party tool to show the most recent commit message on line endings. Seeing the most recent commit message on a line while editing provides immediate context about why a line of code exists, granted your team writes good commit messages.

These are the settings that give me a clean, reliable development environment. If you have settings you swear by, I'd love to see them. What's your favorite VSCode configuration?

{
    "files.insertFinalNewline": true,
    "files.trimFinalNewlines": true,
    "files.trimTrailingWhitespace": true,
    "editor.renderWhitespace": "all",
    "git.blame.editorDecoration.enabled": true
}