Sublime Forum

CursorRuler - Marks cursor position with dynamic rulers

#1

Hi everyone! I created a plugin that addresses the lack of column highlighting in Sublime Text.

github.com/icylace/CursorRuler

Currently trying to get it into Package Control.

Feedback is encouraged,
:smiley:

UPDATE (2013-02-21):
CursorRuler is now available through Package Control!

1 Like

Cursor line/column
What plugins work with ST3?
Column Highlight
How to config it to highlight current indent guide?
Can we please have an option for a block cursor?
#2

Doesn’t seem to work in Sublime Text 2…

Traceback (most recent call last): File "./sublime_plugin.py", line 210, in on_deactivated File "./sublime_plugin.py", line 154, in run_timed_function File "./sublime_plugin.py", line 209, in <lambda> File "./CursorRuler.py", line 199, in on_deactivated File "./CursorRuler.py", line 152, in is_enabled AttributeError: type object 'CursorRuler' has no attribute 'enabled'

0 Likes

#3

Thanks! I made an update so hopefully you won’t be seeing those errors anymore.

0 Likes

#4

Sweet! Thanks for the super fast fix. This looks cool.
It seems I have to restart Sublime Text whenever I change my cursor settings, though. Any chance it could use settings().add_on_change to update automatically? :smile: Sorry I’m so demanding!

0 Likes

#5

Oh, wait, it is using add_on_change… why is it not updating? How strange.

0 Likes

#6

Oh, I see! It looks like the rulers only update when a view is re-activated. I just need to switch to another view and switch back and everything’s good.

0 Likes

#7

Also, this is really cool. Thanks!

0 Likes

#8

Yes, good point! After you save changes to your user settings or your CursorRuler settings the changes take effect once the cursor state changes. I’ve updated my README to note this behavior.

Also, thanks ! :smile:

UPDATE:

Also, thanks for the settings file improvements. I merged them in.

0 Likes

#9

Oh…wow…I like this. Why has no one thought of this before. Thanks for this.

0 Likes

#10

Much appreciated! I’m glad you like it.

0 Likes

#11

could you turn ruler into a dotted line,just like editplus。 a real line make me distracting。

0 Likes

#12

I want to be able to do that too but to the best of my knowledge Sublime Text currently can only do solid lines for rulers. If and when it gains that capability then I’ll be able to incorporate it into CursorRuler.

0 Likes

#13

I am using CursorRuler and am happy with it. Perhaps someday there will also be a CursorHorizontalRuler plugin, or additional options within CursorRuler. For anyone who needs additional visual aids, there is the BlockCursor plugin, and also the following modifications that do not require a plugin:

To change the caret / cursor from a vertical line to an underscore, this is the user profile line of code:

"inverse_cursor_state": true,

One can also change the color of the caret / cursor in the applicable theme file:

<key>caret</key> <string>#FF0000</string>

0 Likes

#14

Thank you for the kind words and tips! I’m slowly working on new things for CursorRuler. I’ll say more when the time is right.

0 Likes

#15

While Cursor Ruler certainly helps with this, I can’t help but feel like this should really be a built-in setting. I would much rather have the column highlight (or ruler) be as thick as the row highlight and similarly affect only the background. Using cursor ruler somewhat like an outline at the moment and it works well (kudos to the dev) but it’s more distracting than the row highlight.

0 Likes

#16

I completely agree with some sort of built-in support. There were some things I wanted to do with CursorRuler but couldn’t because of API limitations. For example, line styling (e.g. dotted, dashed, etc.). In a perfect world the core functionality of my plugin would be built-in and hackable through a nice API. But, alas :smile:

CursorRuler can be made thicker to simulate full column highlighting or as thick as you need to match your row highlight. The 4th example in the description of the cursor_rulers setting is one way of doing it:

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

Despite being awkward, there is a way to change the ruler colors as described here. If you set the color to match your row highlight or even to a more subtle level I bet that would help alleviate it being distractive.

0 Likes

#17

Dear icylace

I just want to thank you it !!!
Works fine for me 75 years old and had dificulties to see wheter
everything was spaced according to the rules.

1 Like

#18

How to display the Row hair? Thanks.

0 Likes

#19

Row hair? If I understand you correctly you may be interested in a preference setting Sublime Text has called highlight_line.

"highlight_line": true,
1 Like

#21

sorted. Thanks.

0 Likes