folke / flash.nvim

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

feature: option to disable labels on each new search #321

Closed TM10YMhp closed 6 months ago

TM10YMhp commented 6 months ago

Did you check the docs?

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

The enabled option of search only changes its initial state.

https://github.com/folke/flash.nvim/assets/91300213/9d8a4c67-e145-44e3-9e80-2808e08c7d9e

Describe the solution you'd like

I would like it to remain disabled each time I do a new search.

Describe alternatives you've considered

None.

Additional context

No response

TM10YMhp commented 6 months ago

I found the answer in discussions https://github.com/folke/flash.nvim/discussions/168, so I'll close this issue. The following adds the functionality I was expecting:

local augroup = vim.api.nvim_create_augroup("plugins.flash", { clear = true })
vim.api.nvim_create_autocmd("CmdlineLeave", {
  group = augroup,
  pattern = { "/", "?" },
  callback = function()
    require("flash").toggle(false)
  end,
})