hadronized / hop.nvim

Neovim motions on speed!
Other
2.47k stars 137 forks source link

Disable when reading or writing macros #301

Closed dotwilliamrc closed 1 year ago

dotwilliamrc commented 2 years ago

It would be great if they add an option to disable the plugin when reading or writing macros

hadronized commented 1 year ago

Not sure what that means.

piersolenski commented 1 year ago

You can't play back macros that require user input each time, such as Hop does.

Say I have the following lines:

The quick brown fox jumps over the lazy dog
A totally different sentence for example's sake.

If I want to record a macro to find the 2nd instance of o, I can do with by starting to record the macro with q. Hop is triggered when I hit f according to the setup hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true }). It assigns v to the 2nd o character. Thus the full macro is fov.

However if I play the same macro back on the second line to find the second instance of o, the characters Hop assigns are now e and t, thus the macro fails with the message no remaining sequence starts with v.

piersolenski commented 1 year ago

A command such as :HopToggle could be useful both for this use case and I imagine many others.

piersolenski commented 1 year ago

See also:

https://github.com/ggandor/leap.nvim#auxiliary-principles https://github.com/ggandor/lightspeed.nvim#notes https://github.com/ggandor/lightspeed.nvim/issues/14

snuffop commented 11 months ago

Well it seems now after reading this, having the same issue, would it not be since f and F are set in the keymaps, that one would toggle that? Hop is just called via key map yes?