Turn on useful settings in Visual Studio Code

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

I've been using Visual Studio Code (VSCode) as my main editor for about a year now.
The development speed is so fast that new and exciting features are being added, but 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 editor. A
recent hot topic is the ability to display a minimap on the left side of the editor.
I still remember the moment when I realized the new idea of ​​"grasping the flow of code with shape" and felt like "my brain has just been stimulated!"

 

editor.minimap.renderCharacters

If you look closely at the minimap, you'll see that the text is still legible, but the actual code is displayed in a tiny font.
By replacing this with color blocks, it felt like the game ran a little faster (to my experience).

This is great if you're writing very long code

 

editor.minimap.showSlider

One more thing about the minimap:
when you hover the mouse cursor over the minimap, the currently displayed area is highlighted, but this setting will keep that highlighted at all times.

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

 

editor.autoIndent

When you copy and paste code or move it using Alt + arrow keys, it can be a hassle to adjust the indentation. This is
especially true when moving multiple lines, so while you shouldn't rely on it too much, it's a useful feature that adjusts the indentation of the moved lines to suit the 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

, I've been using
Fira Code a popular ligature-compatible font in the programming world, I think this is because it takes time and effort to create them, but Fira Code is open source.

It will look like this

While it may seem more intuitive, with the arrow operator appearing as a single character and Markdown header symbols being joined together, it's not for beginners, so please be careful when using it,
especially if you're trying to learn a new language, as it can lead to confusion.

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

There are very few situations in development where you don't need a terminal, so you'll probably find yourself pressing "Ctrl + Shift + @" in VSCode quite often.
Here we'll introduce some settings related to the terminal.

 

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 codes change depending on the environment.
Recently, UTF-8 has become the default, so it's not something we pay much attention to, but on older systems, it's common for them to be 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,
meaning that the newly selected file will be opened in place of the file that was open as a preview.

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've tried to collect some tips and tricks, but how many of them did you already know?
As I wrote at the beginning, VSCode is evolving so quickly that the day may soon come when this article will no longer be useful.
While I'll be sad if that happens, I'll also want to use the more convenient VSCode.

 
That's all

If you found this article useful, please click [Like]!
2
Loading...
2 votes, average: 1.00 / 12
39,443
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 I'm also grateful to be able to do a variety of other work, including marketing.
My portrait rights within Beyond are CC0.