This is not ideal, but if you store xp as a macro, it will be repeated after the macro is executed. So, instead of xp you use, say @s (for swap). Then @@ will repeat this. Not as good as. But it works.
Edit: you know, I'm sure there is a way to do this with some vimscript and tpope repeat.vim . Unfortunately, my vimscript is not up to tobacco. I got to this - maybe someone can fix it, where am I mistaken?
fun! DoSwap() :normal xp silent! call repeat#set("\<Plug>Swap",1) endfun nnoremap <silent> <Plug>Swap :call DoSwap()<CR> nmap <Leader>s <Plug>Swap
The problem is that after entering \s it really replaces the characters you are on, and it repeats when you click . but first it goes to the beginning of the line that this is not what you want. But I think that it can be done, I just do not.
source share