Turn on useful settings in Visual Studio Code

Hello.
I'm Mandai, the Wild team member in charge of development.

I've been using Visual Studio Code (VSCode) as my main editor for about a year now.
The development pace is so fast that amazing new features are constantly being added, but I feel like I'm being left behind...

We have compiled a list of recommended settings so that you can review your settings regularly and take stock of your knowledge

 

Editor-related settings

First, let's look at the settings around the editor, which is the heart of the system.
One of the hottest recent features is the ability to display a minimap on the left side of the editor.
I vividly remember the moment when I realized the new idea of ​​"grasping the flow of code in shape" and felt like my brain had been stimulated!

 

editor.minimap.renderCharacters

Regarding the minimap, if you look closely, the displayed text is somewhat legible, and the actual code is displayed in a very small font.
Replacing this with color blocks made the performance feel slightly (subjectively) smoother.

This is great if you're writing very long code

 

editor.minimap.showSlider

One more thing related to the minimap.
When you hover your mouse cursor over the minimap, the currently displayed area is highlighted, and this setting makes it so that it's always highlighted.

It's great because it helps you know where you are and makes it less likely you'll get lost

 

editor.autoIndent

There are times when it's a hassle to adjust the indentation when copying and pasting code or moving it using "Alt + arrow keys." This is
especially true when moving multiple lines. While you shouldn't rely on it too much, this is a convenient feature that adjusts the indentation of the moved line to an appropriate level based on the surrounding context.

This is great because it eliminates the need to repeatedly press the arrow key → Home key → Tab key

Starting with version 1.15, this feature is now enabled by default! Viva!

 

editor.fontLigatures

This setting uses ligatures, but it is meaningless unless you specify a font that supports ligatures in the font family

a well-known ligature-enabled font in the programming worldFira CodeI've recently started using
I assume this is because they take a lot of time and effort to create, but Fira Code is open source.

It will look like this

While it may appear more intuitive, with arrow operators appearing as single characters and Markdown header symbols appearing concatenated, it's not suitable for beginners, so please use it with caution. It
could easily lead to misunderstandings, especially when learning a new language.

Personally, I find Consolas easier to read, but I like it

It's great that ligature-compatible fonts make programming a little more fun

 

Around the terminal

In development, there are few situations where you don't need a terminal, so you probably often press "Ctrl + Shift + @" in VS Code.
This article introduces some terminal-related settings.

 

terminal.integrated.shell.windows

I think many people probably think that the terminal they use most often is not the command prompt, so I will introduce the settings to change the terminal

A restart is required for the terminal changes to take effect, but if you provide the path to the terminal's executable file to this option, that terminal will be used

As far as I've tried

  • Command Prompt
  • PowerShell
  • Git Bash
  • Bash on Ubuntu (on Windows)

It seems that it is available, and Bash on Ubuntu seems like it would be useful for engineers who work in infrastructure, so that's great

 

terminal.integrated.scrollback

This option allows you to set the maximum line buffer size for the terminal

The default is 1000 lines, but if you have fast-flowing logs or large amounts of output, it's a good idea to increase this value to reduce the chances of missing anything

 

File-related

Here we will introduce the settings for saving files

 

files.eol

Specify the line break code for the file. Specify it as "\n" or "\r\n"

Since line break codes may vary depending on the development environment or project, it is convenient to switch from "User Settings" to "Workspace Settings" and set them there

It's a small thing, but it's important, so I'm grateful

 

files.encoding

Along with line break codes, character encoding is another thing that varies depending on the environment.
Nowadays, UTF-8 is becoming the default, so we don't have to think about it as much anymore, but in some older systems, it's not uncommon to find Shift-JIS.

I only use it occasionally, but I'm grateful for it

 

Global Settings (Workbench)

Finally, we will look at the overall VSCode settings, called the workbench

 

workbench.editor.enablePreview

It depends on the time and situation, but the VSCode editor has a state called preview mode, and when you open it from Explorer, it is in preview state

Until you make any changes, it will be treated as a preview, but if you open another file, the preview editor will be reused.
In other words, the newly selected file will open where the file that was open as a preview was.

If you remember feeling frustrated because you wanted to see the source code side by side, try setting this option to "false" and you might be able to enjoy stress-free coding

You can also display files in a new group by holding down the Ctrl key while selecting them, but unfortunately you can only display up to three groups

You can also open files by dragging them with the mouse, so if you don't mind using the mouse, there's no need to force it off

 

summary

I tried to gather some slightly tricky settings, but how many of them did you already know?
As I mentioned at the beginning, VS Code is evolving so fast that the day may come soon when this article becomes obsolete.
While that would be sad, I'm also eager to use the even more convenient VS Code.

 
That's all

If you found this article helpful,please give it a "Like"!
2
Loading...
2 votes, average: 1.00 / 12
39,645
X Facebook Hatena Bookmark pocket

The person who wrote this article

About the author

Yoichi Bandai

My main job is developing web APIs for social games, but thankfully I'm also given the opportunity to work on various other tasks, including marketing.
My image rights within Beyond are treated as CC0.