Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make ruler always be shown in Sublime text 2?

I use Sublime Text 2 and want a Ruler to be shown in every file with specific line-height. But I have to show it manually in every file.

like image 649
Denis Óbukhov Avatar asked Mar 28 '12 14:03

Denis Óbukhov


3 Answers

Go to Sublime Text > Preferences > Settings - User

Add a "rulers" setting with the lines you want for the ruler:

// Adds a single vertical ruler at column 80
"rulers": [80],

If you want multiple rulers, separate the values with a comma:

// Adds two vertical rulers: one at column 80 and one at column 120
"rulers": [80, 120],

Rulers not showing? Rulers are only shown when using a monospace font, which is the default font for Sublime Text. Ensure you are using a monospace font if the settings above don't work for you.

like image 158
Ross Allen Avatar answered Nov 20 '22 12:11

Ross Allen


Edit the "rulers" value in the default settings to contain the column number you want the ruler to be displayed on, and it will persist.

like image 20
Robert Jones Avatar answered Nov 20 '22 10:11

Robert Jones


Never edit Settings - Default; edit Settings - User instead. If you upgrade your SublimeText version you will lose all of your settings because Settings - Default will be overwritten.

In the Packages folders the 'User/' folder will be ignored between upgrades of SublimeText, the settings here will be persistent.

To enable the persistent rulers in any document, add the settings in Defaults - User:

{
  "rulers": [75, 80, 85]
}

This example will display 3 rulers, at 75, 80 and 85 chars length.

like image 52
Tecnocat Avatar answered Nov 20 '22 11:11

Tecnocat