Problem:
How do I add vertical rulers in Visual Studio Code's editor views?
I want to add standard guide rulers at the 80 and 120 character columns.
Solution:
In VSCode 0.10.10 or newer:
- Open Settings
(Windows: File→Preferences→Settings; OS X/MacOS: Code→Preferences→Settings) - Search for "editor.rulers", then select to edit
- Add the number of columns the rulers should be at. For example, the classic standards of 80 characters and 120 characters are shown below:
- You should now see vertical rulers in your editor if done correctly and if your Visual Studio Code version is compatible. For older versions, restarting VSCode may be required to see the change.
Notes:
The solution above was tested to work on Visual Studio Code 1.44.0. Your results may vary in other versions.
References:
- https://code.visualstudio.com/docs/getstarted/settings (search in the page for "editor.rulers")
- For even more answers, customizations, and suggestions have a look at the answers in this Stack Overflow question
No comments:
Post a Comment