SkepticMystic / advanced-cursors

Apache License 2.0
100 stars 2 forks source link

[Feature Request] New Command -> Advanced Cursors: `Previous` #11

Closed FelipeRearden closed 3 years ago

FelipeRearden commented 3 years ago

Hello @SkepticMystic !!!!

The new command Advanced Cursors: Next is an amazing new feature to navigate inside the note as I mentioned here #1

My FR is related to this: what about a new command that is the opposite of Advanced Cursors: Next. Instead of find the next match, we could have a command to find the previous match. Advanced Cursors: Previous

User Case - Navigation between Headings

For navigation would be a good option to go to the previous header.

Example 1: I'm in a long text inside an h4 this is inside of an h3.

Example 2: would be to just go to the nearest (active) header based on caret position.


I don't know if it is a feasible FR, but might be a good option for the users :)

Thanks for reading this! Have a great day!

SkepticMystic commented 3 years ago

Thanks for the FR! I totally agree, this will be a useful feature to have :) It's on my list.

FelipeRearden commented 3 years ago

Thank you very much @SkepticMystic !!!

SkepticMystic commented 3 years ago

@FelipeRearden I've implemented this in 0.0.34 (actually 0.0.35). Let me know your experience with it :)

FelipeRearden commented 3 years ago

Hello @SkepticMystic !!!!

First of all, I'm sorry for the late reply. I saw you message early but I finally could take some time now to test and write to you :)

Thank you very much! The new command is amazing and a great companion to Move to next instance of current selection !

Forgive to say this, but I was thinking in a different command :)

If you don't mind, let me share my idea. I'm gonna use this Note as my global example:

0

My idea

My idea is to have these 3 three commands applied to an specific Query. Using my backlinks Query:

In this note I have three backlinks : [[Marcus Aurelius]] [[Seneca]] [[Stoicism]]

My caret position is in the line 3:

1

Objective 1: got to the next backlink Step 1: Press - Advanced Cursors: Next - Backlinks --> (?<=\[\[)(?!.*#\^).*?(?=\]\]) to go to the next backlink [[Stoicism]]

2

Objective 2: got to the next backlink Step 2: Press - Advanced Cursors: Next - Backlinks --> (?<=\[\[)(?!.*#\^).*?(?=\]\]) to go to the next backlink [[Marcus Aurelius]]

3

Objective 3: got back to the previous backlink Step 3: Press - Advanced Cursors: Previous - Backlinks --> (?<=\[\[)(?!.*#\^).*?(?=\]\]) to go back to the previous backlink [[Stoicism]]

As you can see, with a new command we can navigate back and forth using a dynamic query (more about this below)

My Idea applied to the new command Move to previous instance of current selection

Objective 1: got to the next backlink Step 1: Press - Advanced Cursors: Next - Backlinks --> (?<=\[\[)(?!.*#\^).*?(?=\]\]) to go to the next backlink [[Stoicism]]

2

Objective 2: got to the next backlink Step 2: Press - Advanced Cursors: Next - Backlinks --> (?<=\[\[)(?!.*#\^).*?(?=\]\]) to go to the next backlink [[Marcus Aurelius]]

3

Objective 3: got back to the previous backlink Step 3: Press - Move to previous instance of current selection to go back to the previous backlink [[Stoicism]]

3

As you can see, I got stuck at since it's using the current selection now is /Marc us Aurelius/gm is used as the input for the new query I was not able to navigate to the previous backlinks [[Seneca]]

That's what I was thinking when I wrote this FR :) !!!!

Move to previous/next instance of current selection are AMAZING for static queries

I'm calling this /(?<=\[\[)(?!.*#\^).*(?=\]\])/gm dynamic queries because it has different outputs -> Seneca, Stoicism , Marcus Aurelius I'm calling this /Loren Ipsum/gm static queries because it will always return Loren Ipsum

This new command is amazing for a quick search in the note !!!!!!!


Sorry for not made this clear in the FR. I don't know if what I described is even feasible :)

I hope you are not mad at me. I'm so grateful for everything that you have been doing for this plugin :) take a look what we have accomplished between version 0.0.3 and 0.0.37 it's amazing!!!!

I wish you a fantastic day @SkepticMystic !

SkepticMystic commented 3 years ago

Felipe, hey :) Do you mean like this?

Imgur

If so, it will be in the next release :D

SkepticMystic commented 3 years ago

Basically, dynamic Prev and Next, as you specified

SkepticMystic commented 3 years ago

Thank you as always for the detailed FR, btw :) And thank you for helping me get this plugin to where it is right now!

FelipeRearden commented 3 years ago

YES YES YES !!!!!!!!!!!!!!

FelipeRearden commented 3 years ago

I think you already know that I'm looking for this command :)

thanks @SkepticMystic !!!!!!!!

SkepticMystic commented 3 years ago

Haha gimme a sec, just finishing up the release, but it will be live soon :)

SkepticMystic commented 3 years ago

Cool, should be working in 0.0.39

FelipeRearden commented 3 years ago

Thank you as always for the detailed FR, btw :)

Thanks! 😄 😄 😄 😄

And thank you for helping me get this plugin to where it is right now!

For me it's always a great time when we talk about this new features. I have to say thank you to you for giving to us the opportunity to share our ideas.

I'm having a great time @SkepticMystic !!!

Haha gimme a sec, just finishing up the release, but it will be live soon :)

Sure :)

FelipeRearden commented 3 years ago

Cool, should be working in 0.0.39

Thanks !

Taking a look right now @SkepticMystic. I get back to you in a few minutes :)

FelipeRearden commented 3 years ago

Just to inform that the changelog is inside the Settings Screen..... getting back to test ......

10

FelipeRearden commented 3 years ago

Cool, should be working in 0.0.39

Working 30000% perfect on Obsidian 0.12.15 version 0.0.39 !!!!

What a great set of features @SkepticMystic !!!

There is no reason to use the native active search. We can do more and faster AND without a mouse with the might Advanced Cursors 😃

Thanks @SkepticMystic for making this FR a real workflow :)

SkepticMystic commented 3 years ago

Haha that's great to hear it's working! :D

Haha I know the changelog is in settings... I know it would be better in the Readme, but I don't know how to embed it there... maybe it is possible

FelipeRearden commented 3 years ago

Haha that's great to hear it's working! :D

Haha I know the changelog is in settings... I know it would be better in the Readme, but I don't know how to embed it there... maybe it is possible

Great idea @SkepticMystic to put the changelog inside a button :)