Editor Rulers
Add vertical column rulers to the editor to keep track of line lengths. By default, a single ruler is set at the 120-character position.
Enabling and Disabling Rulers
Toggle the visibility of rulers through the View > Rulers
menu option.
Adding Multiple Rulers
To add multiple rulers, edit the preferences file:
- Navigate to
File > Open Preferences File
. - Add the following entries to the JSON configuration:
{
// existing json items
"editor.rulers": [40, 80],
"editor.rulerColors": ["green", "#f34d5a"],
}
These settings introduce two rulers at the 40th and 80th character positions, colored green and red respectively.
Configuration Options
editor.rulers
: Specifies an array of column numbers where vertical rulers will appear.editor.rulerColors
: An optional array to set colors for each ruler, corresponding to the positions listed ineditor.rulers
.
FAQ
Q: How do I add different rulers for each project?
To set up different rulers for individual projects, create a .phcode.json
file
in the root directory of each project. Include the same ruler configurations as
shown in the example above.