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

Is it possible to use the semicolon to repeat (continue actually) a jump? #343

Open svanharmelen opened 1 month ago

svanharmelen commented 1 month ago

My config looks like below, so I primarily use flash by hitting s or S, typing some chars and then select the label of the thing I'm aiming for (my target).

Now more then often I find myself updating or changing something at the target location and then realize I want to repeat that action in a similar part of my code so my muscle memory makes me hit ; to repeat the action and somehow I expect it to repeat hitting s again and typing in the same chars to get the labels again allowing me to choose the next target.

Would something like that be possible somehow? I thought maybe the continue option was for that, but that doesn't seem the case.

Thanks!

return {
  'folke/flash.nvim',
  event = "VeryLazy",

  keys = {
    {
      's',
      mode = { 'n', 'x', 'o' },
      function()
        require('flash').jump({
          search = { forward = true, wrap = false, multi_window = false },
        })
      end,
    },
    {
      'S',
      mode = { 'n', 'x', 'o' },
      function()
        require('flash').jump({
          search = { forward = false, wrap = false, multi_window = false },
        })
      end,
    },
  },

  config = function()
    require('flash').setup {
      continue = true,
      modes = {
        char = {
          enabled = false,
        },
        search = {
          enabled = false,
        }
      }
    }
  end,
}