Wednesday 15 April 2020

1 way to add vertical rulers in Visual Studio Code

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:

  1. Open Settings
    (Windows: File→Preferences→Settings; OS X/MacOS: Code→Preferences→Settings)
  2. Search for "editor.rulers", then select to edit
  3. Add the number of columns the rulers should be at. For example, the classic standards of 80 characters and 120 characters are shown below:
  4. 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:

No comments:

Post a Comment