tpope/vim-repeat

Issue with Vim Surround, C-R is broken in normal mode

aymericbeaumet opened this issue · 13 comments

After installing vim-repeat, when I perform a vim-surround action (like cs'" for example), the C-R bind is broken.

How to reproduce it (consider dots as spaces):

....'abc'

Type: cs'"

...."abc"

Type: C-R

.."abc"

Instead of redo, C-R deletes two spaces on the left.

The problem disappears when I uninstall vim-repeat.

Your example doesn't make any sense. Ctrl-R "redo[es] changes which were undone." And you didn't undo anything. The fact that it does something makes me think you've got Ctrl-R mapped to something.

I know what C-R does. I just described a strange behaviour I noticed.

I forgot that repeat.vim can map Ctrl-R. After that cs, it should be :<C-u>call repeat#wrap("\<C-R>",v:count)<CR>.

I found the source of the problem, see my answer on an other issue here.

Hi aymericbeaumet,

Can you please explain how u fixed the issue? I am also seeing the same

@justrajdeep it was a problem with his 'cpoptions'

Hi graywh,
Mine has 'Aq' .What is the solution? what should 'cpoptions' be set to?

@justrajdeep I think you'll need to add B. Do you have reasons for not using aBceFs?

Hi grayhw
i copied the vimrc from my senior, not sure why this was set in his. I will remove it.

@justrajdeep Yeah, gotta watch out for vimrc cargo culting.

@justrajdeep It seems you got your answer ;)

Yes. Thanks :)