- 1. Visual Studio Code, VSCode, introduction.
- 2. VSCode, install and screen explanation.
- 3. VSCode, Settings.
- 4. VSCode, Settings.json file.
- 5. VSCode, plugins.
- 6. VSCode, plugin: Live Server.
- 7. VSCode, Workspaces.
- 8. VSCode, Project and Project plugins.
- 9. VSCode, Live Sass Compiler.
- 10. VSCode, Live Sass Compiler and Bootstrap.
- 11. VSCode, Watching. To be written.
- 12. VSCode, Other plugins.
- 13. VSCode, Tips for Visual Studio Code.
- 14. VSCode, Usefull Links.
4. VSCode, Settings.json file.
You can find a definition of the json format in:
"Wikipedia, JSON file format."
Every VSCode setting is written to the default settings.json file. There is also a settings.json file for every user. The settings that do not have their own place on the settings tab, have to be written into this user settings file. This example comes from the wikipedia page:
As you can see the file is neatly formatted too. Notice there
are levels, ( firstname, lastname and address are the same level), and
inside the address you can see a next level with for instance city and
state.
I will not describe the formatting of the file itself, only
show you the importance of the levels. You can see there are 2 types
of brackets used:
{ } and [ ] , also notice the placement of
comma signs, all lines inside a bracket, end with a comma, except
the last line in that level.
If you are making changes to your settings.json file, keep those thinghs
in mind. Before you save your changes, check opening and closing brackets
and the correct placing of commas.
The examples in this article will have the correct syntax and are cut
and paste ready.
Visual Studio Code, vertical rulers. (thin vertical help lines)
To help you find in which column the cursor is positioned, you can have 1 or more thin vertical help lines, (vertical rulers), inside the editing window of VSCode. This has to be changed in the settings.json file of VSCode.
If you want to know more about a json file, you can have a quick look at this very short tutorial:
To set the rulers in VSCode, type rulers in the searchbox on the settings tab.
After clicking on Edit in settings.json we get:
VSCode opens the settings.json file and fills it with
an empty block for the rulers specification.
The cursor is already blinking where you have to type the
text. Notice the little dot in the file tab, denoting the file has
changed and needs to be saved.
Every ruler has 2 possible parameters: the column in which the ruler is positioned, and a color value for the ruler itself. The color is not necessary, default is grey.
Now cut and past the above code so the file looks like this:
Again notice the dot in the file tab. Make sure the code looks like the one above, with the brackets and commas in the right places. Save the file and you will get:
The rulers have no special function, so it does not mean codelines end at the position of a ruler. They are only there to help you see where you are on a line.
Visual Studio Code, problems when clicking in the scrollbar.
It turns out VSCode has a different way of handling a click in its scrollbar. The normal windows way of clicking in a scrollbar is to jump 1 page up or down in the source file, depending where you click.
Unfortunately, VSCode does not do that. It jumps to the position in the file, that is approximately the percentage of the lenght of the file that corresponds to the click position in the scrollbar.
There has been a change request for VSCode:
"Make Clicking in Scrollbars Move By Page #104923."
But at the time of this writing it is not yet documented very well. If you want VSCode to just move 1 codepage, while clicking in its scrollbar, you have to do the following:
Make sure VSCode is selected, so make sure the mouse is not inside another program, or the character combination will not have the correct effect. Choose the character sequence CTRL+SHIFT+P, that will open the command palette like this:
Inside the box type Open Settings
While typing you can see VSCode searching already, as in the above screenshot.
Now choose the command: Open Settings (JSON) and you will get:
In this screenshot the correct line is already there, thats because in my VSCode it has already been changed.
Notice the extra comma in the line just before it !
If your file looks like the above you can save.
What I found was, that after saving I needed to restart VSCode for it to work.