nvim-treesitter/nvim-treesitter-refactor

Allow smart_rename's grr mapping to be repeatable using '.'

daedroza opened this issue · 4 comments

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I am using / to find a function and use smart_rename to modify the function name. Now I am find next usage and attempting to use '.' to rename it exactly the same as previous one. I don't intend to use sed as I don't want to perform the name change through out the file. Few instances that can be could rotated using N and n, then replaced using '.' that previous smart_rename had stored for.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Implement '.' for repeating smart_rename.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I couldn't think of any, hence none.

Additional context
Add any other context or screenshots about the feature request here.
None.

Hi @daedroza! Did you find a solution for this? I was looking for the same and found this issue.

I am not sure how I got it to work but you can try this https://github.com/tpope/vim-repeat

Thanks for your reply! Maybe I'm missing something but wouldn't treesitter-refactor need to support vim-repeat natively for that to work? Ie by calling repeat#set by the end of the mapped function?

I just use change-in-word motion and repeat it that is much easier and support larger array of functions such as deletion, etc.