How can vertical rulers (note the plural) be configured in Visual Studio Code?
In Sublime Text 2 I can do
"rulers": [72, 80, 100, 120]
How does this work in Visual Studio?
"editor.ruler": 80
produces only one vertical ruler.
Keyboard shortcut for vertical block selection: To select code block vertically in your visual studio code, use Shift + Alt and then use the mouse to select lines vertically, from top-left to bottom-right.
Definitions. A bar displayed along the left side of a document window. You can use the vertical ruler to adjust the top and bottom page margins and the row height in tables.
Visual Studio Code 0.10.10 introduced this feature. To configure it, go to menu File → Preferences → Settings and add this to to your user or workspace settings:
"editor.rulers": [80,120]
The color of the rulers can be customized like this:
"workbench.colorCustomizations": { "editorRuler.foreground": "#ff4081" }
In addition to global "editor.rulers"
setting, it's also possible to set this on a per-language level.
For example, style guides for Python projects often specify either 79 or 120 characters vs. Git commit messages should be no longer than 50 characters.
So in your settings.json
, you'd put:
"[git-commit]": {"editor.rulers": [50]}, "[python]": { "editor.rulers": [ 79, 120 ] }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With