Skip to content
Ron Martinez edited this page Jul 27, 2016 · 4 revisions

The default settings file may be accessed through the menu by going to Preferences -> Package Settings -> CursorRuler -> Settings – Default. The Settings – User option may be used to either open up the custom user-specific settings file or to create it if it doesn't exist yet.

The following settings are available. They are shown here with their default values.

{
  "cursor_rulers": [-0.1, 0.2],
  "enabled":       true,
  "synchronized":  true
}

To use custom settings first create a file called CursorRuler.sublime-settings in your User folder which should be located within your packages folder. Then copy the aforementioned default settings into this file, make your adjustments, and then save the file. Your changes should take effect the next time the cursor is moved on an open non-previewed file.

cursor_rulers

A list of column positions relative to the cursor position where dynamic rulers should appear. They can be any decimal number. 0 represents the current cursor position so

{
  "cursor_rulers": [0]
}

means display a single dynamic ruler exactly where the cursor is. You could experiment with something like

{
  "cursor_rulers": [-0.1, 0, 0.2]
}

if you wanted something thicker. The default (what I personally use) which is

{
  "cursor_rulers": [-0.1, 0.2]
}

tries to be thick without being too distracting. If you didn't specify any dynamic ruler positions as in

{
  "cursor_rulers": []
}

Then you won't see any dynamic rulers. Why would you want to do this? Not sure...yet.

You could also try something like

{
  "cursor_rulers": [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
}

if you wanted to simulate column highlighting! It's not perfect and can look a little odd at larger font sizes but it's the next-best thing to the real thing.

If for some reason you had set cursor_rulers to a nonsensical value like "foobar" then the default dynamic rulers will be used instead.

Now for some crazy stuff. The following examples illustrate the silliness that's possible with multiple cursor rulers.

It's possible there might be some people who would consider this first example useful:

{
  "cursor_rulers": [-4, -0.1, 0, 0.2, 4]
}

The potential usefulness comes from ability to know at a glance what is cleanly indented and outdented relative to the cursor. In this case the indent spacing is assumed to be 4. The disadvantage here is that it looks visually cluttered (at least to me).

This next example illustrates a much more experimental "gradient" highlighting style:

{
  "cursor_rulers": [-2.4, -1.7, -1.2, -0.8, -0.4, -0.2, -0.1]
}

It shows several rulers trailing to the left of your cursor. It may ultimately be too showy to be practical but it does have its own feel once you get used to it.

This final example is yet another experimental highlighting style. This one doesn't highlight the cursor position directly but instead creates a "tunnel" which is centered around the cursor:

{
  "cursor_rulers": [-4.7, -4, -3.4, -3.1, -3, 3, 3.2, 3.5, 4.1, 4.7]
}

As you can see, a variety of sometimes useful, sometimes strange highlighting possibilities are out there.

default: [-0.1, 0.2]

enabled

If you have it normally disabled you can enable it for when you need it by using the CursorRuler: Toggle Enabled/Disabled command from the Command Palette. Use the same command again to turn it back off.

default: true

synchronized

Multiple views of the same file will show cursor rulers that move together in synchronized fashion. This is most useful when using the Rows: 2, Rows: 3, or Grid: 4 layout and having multiple views of the same file being used in different groups.

default: true

Clone this wiki locally