flash.nvim icon indicating copy to clipboard operation
flash.nvim copied to clipboard

feature: autojump when only one match even if jump_labels = true in char mode

Open xtrats opened this issue 1 year ago • 4 comments

Did you check the docs?

  • [X] I have read all the flash.nvim docs

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

My char mode config is below, I set jump_labels = true so I can decide to jump where I want when there are multiple matches:

{
  "folke/flash.nvim",
  event = "VeryLazy",
  opts = {
    label = {
      uppercase = false,
    },
    modes = {
      char = {
        jump_labels = true,
        multi_line = false,
        jump = {
          autojump = true,
        },
      },
    },
  },
  -- stylua: ignore
  keys = {
    ...
  },
},

for example, in codes below, cursor is before the "s" in "sizeof":

std::cout << sizeof(DataHdr) << std::endl;

There are two situations:

  1. If I want to delete the string "sizeof(DataHdr", after I typed dt), then a label ("s" in real case) showed in the place of ")", I had to input s to finish the job.
image
  1. If I want to delete the string "sizeof(DataHdr)", after I typed df), then the string ("sizeof(DataHdr)") is select, I had to input <CR> to finish the job.
image

Describe the solution you'd like

In char mode, when there is only one match, when I typed dt( or df(, delete the string directly, so there is no another label or <CR> needed which is not necessary.

Describe alternatives you've considered

no alternatives for now, type one more key if no solutions.

Additional context

No response

xtrats avatar Jul 25 '23 09:07 xtrats

@xtrats hi! what is this gorgeous font you are using?

RayJameson avatar Aug 12 '23 13:08 RayJameson

@xtrats hi! what is this gorgeous font you are using?

@RayJameson Fire Code (https://github.com/tonsky/FiraCode), I changed some characters to their variants (like 'r').

xtrats avatar Aug 16 '23 11:08 xtrats

@xtrats hi! what is this gorgeous font you are using?

@RayJameson Fire Code (https://github.com/tonsky/FiraCode), I changed some characters to their variants (like 'r').

thanks a lot!

RayJameson avatar Aug 16 '23 20:08 RayJameson

would love this feature too!

mintelm avatar Nov 22 '23 12:11 mintelm