folke / flash.nvim

Navigate your code with search labels, enhanced character motions and Treesitter integration
Apache License 2.0
2.22k stars 27 forks source link

feature: Can jump label (highlight character) show at the beginning of matched pattern? #291

Closed hrcHarry closed 4 months ago

hrcHarry commented 7 months ago

Did you check the docs?

Is your feature request related to a problem? Please describe.

Hi

When we use / to search some word, the jump label is shown at the end of the currently matched pattern, like the following example.

If we are not familiar to the set of similar variable names (i.e., we do not know the next character), the jump label shown at the end will hide the next character to reduce efficiency that narrowing down the "jumping" candidates.

For example, there are a bunch of label and labal in code; to search labal, we type /lab and get some candidates. Remember that we are not familiar to these variable names. Now the jump label hide the next character of /lab to obstruct the searching --- we are not sure that what is the next character --- like the figure shown above.

Describe the solution you'd like

Let the jump label show at the beginning of the matched pattern, as shown below.

Describe alternatives you've considered

None.

Additional context

The jump label which is shown at the beginning is fine because, in this example, to search labal, we must know the first character is l and, then, we type /l without obstacle.

shivamchandra75 commented 5 months ago

@hrcHarry I think what you are looking for is label.before set it to true and set label.after to false.

Screenshot 2024-01-09 at 9 43 33 PM

but I still think it would be great if we had an option to display jump lablel on top of the search character

xzbdmw commented 5 months ago

@hrcHarry I think what you are looking for is label.before set it to true and set label.after to false.

Screenshot 2024-01-09 at 9 43 33 PM

but I still think it would be great if we had an option to display jump lablel on top of the search character

Could you share your noice config that makes search pop up like your screen? I tried and failed.

hrcHarry commented 4 months ago

@hrcHarry I think what you are looking for is label.before set it to true and set label.after to false.

Screenshot 2024-01-09 at 9 43 33 PM

but I still think it would be great if we had an option to display jump lablel on top of the search character

Could you share your noice config that makes search pop up like your screen? I tried and failed.

Hi. In packer, I tried the similar setting and it fails. You may use flash.nvim installed by Lazy.nvim and configured as shivamchandra75's setting. It works. Hope that helps.