vigna / ne

ne, the nice editor
http://ne.di.unimi.it/
GNU General Public License v3.0
473 stars 33 forks source link

Feature request: Search upwards #79

Closed kroggen closed 3 years ago

kroggen commented 3 years ago

Hello!

It is very common to me the requirement to make a search from where the cursor is located upwards.

What about the interface to be like this:

Ctrl+F to open the Search bar, then Shitf+Enter to search up.

Then Ctrl+G will search for the next occurrence, remembering the direction.

vigna commented 3 years ago

Why don't you bind SearchBack to Shift+Enter (given that you have a sequence for that)? You can invoke it before Ctrl+F, and the status bar will tell you whether you're going forward or backward (it's the third letter—a 'b' will appear if you're searching back).

kroggen commented 3 years ago

Oh, I did not know that it already supports it.

How do we make a search up? There is no bound keys for that feature?

I was not able to find on the default.keys

I did not understand this: "given that you have a sequence for that"

vigna commented 3 years ago

If you read my comment, it says to bind SearchBack to a key. You can execute it as a command anyway.

utoddl commented 3 years ago

SearchBack is not in the menus either, which surprised me a little bit. I rarely use it, but when I do I just set / reset it from the command prompt:

^k sb <Enter>

Re: "given that you have a sequence for that" -- he meant that would work if and only if your terminal sends some character sequence for Shift+Enter that ne can distinguish from plain old Enter. (Mine doesn't.) You can experiment with some key combinations to see what ne sees for them with the KeyCode command. Bring up the command prompt (^k) and enter kc and Enter, then hit the key or key combination you want to check -- Shift+Enter for example. For my terminal, ne sees exactly the same thing it sees for a plain Enter. Likewise for Ctrl+Enter and Ctrl+Shift+Enter. If you want to map a key or key combination to SB (SearchBack), you'll probably have to pick something besides the Enter key.

kroggen commented 3 years ago

Oh, I never "executed" nor "bound" anything on ne before, this is why I was a bit lost. But now I got it.

Thank you so much for your help!

PS: I agree, it could be in a menu