Sublime Forum

(ST3) FindCursor

#1

Simple little plugin that will briefly make all cursors highly visible. It also cycles through all cursors centering them in your view. After a couple of seconds, the cursors should return to whatever you had them set to before.

I personally like to have a low profile cursor. But on the occasion I have scrolled far away from the cursor, or for whatever reason have lost sight of my cursor, I use this to quickly make the cursor very visible and centered. It is also useful for cycling through all of your cursors.

You can also use “pan mode” that will pan through the view showing cursors opposed to iterating through all of the cursors.

Repo is here: github.com/facelessuser/FindCursor

Set up a keymap something like this (You don’t have to have two that cycle in opposite directions, if you want, you can just use one):
[pre=#232628] //////////////////////////////////
// Find Cursor: Iterative Find
//////////////////////////////////
{
“keys”: “ctrl+.”],
“command”: “find_cursor”,
“args”: {“reverse”: false, “pan”: false}
},
{
“keys”: “ctrl+shift+.”],
“command”: “find_cursor”,
“args”: {“reverse”: true, “pan”: false}
}

//////////////////////////////////
// Find Cursor: Panning Find
//////////////////////////////////
{
    "keys": "ctrl+."],
    "command": "find_cursor",
    "args": {"reverse": false, "pan": true}
},
{
    "keys": "ctrl+shift+."],
    "command": "find_cursor",
    "args": {"reverse": true, "pan": true}
}[/pre]

Just thought I’d share.

0 Likes

Finding the cursor
#2

Thanks for sharing it, very useful!

0 Likes

#3

Nice plugin thanks, I’ll try it.

You may be interested in this one:
https://github.com/bizoo/Sublime-Selections/blob/master/navigate_selections.py
it navigate trough invisible cursors, so it means that it navigate to the next/previous cursor outside the actual visible region.
I think it’s more handy this way.

0 Likes

#4

[quote=“bizoo”]Nice plugin thanks, I’ll try it.

You may be interested in this one:
https://github.com/bizoo/Sublime-Selections/blob/master/navigate_selections.py
it navigate trough invisible cursors, so it means that it navigate to the next/previous cursor outside the actual visible region.
I think it’s more handy this way.[/quote]

Ahh, I see what you did. Very nice. I guess what I was solving first and foremost was when I sometimes can’t see the low profile cursor that may or may not be visible. The idea was to make it super visible so there was no doubt where it was. I then thought it would be nice to certain it as well, so then you would now where to look (in cases where the cursor could be centered). Then I decided to take it further. So now it takes you to the first, and then if you press it again, it takes you to the next cursor (visible or outside visible region).

But thinking about now after seeing your plugin, maybe what might be useful is to highlight the first visible cursor, and then cycle through them in the direction of your choice.

0 Likes

#5

Or maybe…just make visible cursors highly visible on first press, then additional presses begin cycling through cursors starting with first non-visible cursor. I will play around and see what works best.

0 Likes

#6

Okay, the next iteration, once I get some time, will have two methods of showing cursors. Both methods on first access will make current visible cursors highly visible (center will center first visible cursor). Additional presses will either sequentially iterate through the cursor and center them, or pan the view to show cursors off screen.

So basically I will have a center mode or a pan mode. But both modes will start with what is visible and move in your chosen direction.

0 Likes

#7

Added panning mode. I will refer to the default mode now as iterative mode. Anyways, the commands have now changed, so if you update, you should see the opening post to see the new command format. You can select to use the default iterative mode or the panning mode.

Searches should now always start out relative to the viewable region as well.

0 Likes

#8

One more small update:

  • Iterative find now focuses the cursor closest to viewable center
  • Once cursors have returned to normal, next iterative find will be relative to whatever cursor is now closest to center opposed to the last cursor index found
  • FIX: some small logic fixes
0 Likes

#9

Now available in its own repo github.com/facelessuser/FindCursor.

0 Likes

#10

Just tried it and works perfectly.
Thanks for sharing.

0 Likes

#11

A small suggestion:
In pan mode, the first run of the command only make cursors visible without panning which is fine when there is already cursors visible on the screen.
But when there’s no cursors currently visible, I think it must directly span to the next/previous cursor.

0 Likes

#12

I would agree. That was the intention, but apparently I must not be falling back to that like I should. I will double check the code.

0 Likes

#13

@bizoo, you should be good now. I just patched pan mode to properly fallback to panning on first activation if no cursors in the viewable region are found.

0 Likes

#14

Works great, thanks.

Once again I replace one of my own plugin by one of yours which is better.

0 Likes

#15

Not my original intention, but I am glad you like it :smile:. With that said, I did like your idea of panning through the selections; it is a nice touch.

0 Likes

#16

Now on Package Control

0 Likes

#17

Nicely done !

0 Likes

#18

Thanks!

0 Likes