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

Sublimetext2SublimetextRulers

Sublimetext2 Problem Overview


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.

Sublimetext2 Solutions


Solution 1 - Sublimetext2

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.

Solution 2 - Sublimetext2

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.

Solution 3 - Sublimetext2

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.

Solution 4 - Sublimetext2

As others have stated before me, select Preferences -> Settings-User and change

"rulers": [],

to

"rulers": [80],

in order to display one ruler at column 80.

Now for the rub, it seems that one must use a monospaced font in order to display rulers so you'll also need to change

"font_face": "",

to

"font_face": "Monospace",

or any other monospaced font.

Thinking about it, this makes sense. If different characters have different widths, then the ruler could potentially not be a single line, but a bunch of annoying line segments. I noticed this while using the default font and my column numbers were not the same for the same vertical position. At the same time, my fancy ruler was specified but not displayed. Changing the font to Monospace solved both problems.

Solution 5 - Sublimetext2

While the answer by Ross Allen is great, it isn't the most convenient if you find yourself wanting to toggle the rulers on and off or change the width at various points while using Sublime.

Luckily, someone made a Package that allows you to do this.

https://packagecontrol.io/packages/QuickRulers

The package works in both Sublime Text 2 and 3.


Install Instructions:
  1. Install PackageControl
  2. Open PackageControll (e.g. via ⌘ + SHIFT + P)
  3. Type "Install" and select "Package Control: Install Package"
  4. Type "QuickRulers" and hit Enter to install the QuickRulers package.

You can access the command (quick_rulers) through several different means, but by default it is loaded in Omnisearch via "QuickRulers: Open Panel". (i.e., Hit ⌘ + SHIFT + P and type "QuickRulers: Open Panel")

Solution 6 - Sublimetext2

If you change font, ruler will not be displayed. E.g. I set "font_face": "Lucida Grande", and ruler disappeared.

Solution 7 - Sublimetext2

I just had this problem and noticed that the my ruler was only showing up when I was slightly scrolled to the right horizontally. Turns out the reason it was disappearing was because I was slightly zoomed in. Press Cmd+0 to make sure you are zoomed to the default 100% size before trying other things in case this is also your issue.

(I am using Sublime Text 3)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDenis ÓbukhovView Question on Stackoverflow
Solution 1 - Sublimetext2Ross AllenView Answer on Stackoverflow
Solution 2 - Sublimetext2Robert JonesView Answer on Stackoverflow
Solution 3 - Sublimetext2TecnocatView Answer on Stackoverflow
Solution 4 - Sublimetext2Michael RuthView Answer on Stackoverflow
Solution 5 - Sublimetext2romellemView Answer on Stackoverflow
Solution 6 - Sublimetext2German KhokhlovView Answer on Stackoverflow
Solution 7 - Sublimetext2ctlockeyView Answer on Stackoverflow