‘VS code’ is a very useful and powerful source code editor for programmers and scientists. It has many configuration options for advanced users. However it is a bit difficulty to configure all these options because its options are edited rather than checked on buttons as normal windows applications. Here, I just share my configuration of VS code as a backup for easy use and reconfiguration after new installation.
Default setting
The setting of VS code is different from normal software which uses check options and menus. VScode use script to control the default settings. The configuration script file ‘settings.json’ is like this:
1 | { |
Stop workspace trust check
Every time you opened a script file, VScode will ask your trust. To avoid this annoy thing, you can just change the default setting in VScode setting.json as:
1 | # "security.workspace.trust.untrustedFiles": "open", |
Auto wrap long line
The setting method has been discussed in stackoverflow [https://stackoverflow.com/questions/38561881/how-do-i-turn-on-text-wrapping-by-default-in-vs-code], you can just open the: File -> preference -> setting and change the “editor.wordWrap”: “off” to “on”.
Add vertical width indication ruler at 80
You can also set custom the vertical ruler at 80 line length by change the settings.json [https://stackoverflow.com/questions/29968499/vertical-rulers-in-visual-studio-code]. You need to add a new line as “editor.rulers”: [80,120], and then save the .json file.
Turn on English spelling check
When I write markdown blog with VS code, I would like to turn on the British English spelling check for the markdown source code. This could also be easily realized in VS code by install the 3rd plugin: ‘Code Spell Checker’ [https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker]. And then make the configuration as: Code Spell Checker -> extension setting -> C Spell: Language, en-GB