Closed olymk2 closed 6 years ago
I can't reproduce. Could you give more details like which keys you press?
cannot reproduce.
tried with ysiw"
.
I am using viws" to select the word in the cursor and surround it, followed by moving the cursor up or down and pressing . to repeat the last command.
using ysiw" actually works, can you explain it ? y is yank s surround i presume I in w word and quote for the surround, reading that it does not make as much sense as visual in word surround quote, why yank ?
Ah, now I see why it does not work for you. Selection operations are not repeatable in vim keybindings. Actually there are people that say that beggining a vim command with v
is an anti-pattern because you can not repeat it. Test on your own on an empty buffer. See that viWU
and .
does not repeat while gUiW
and .
repeats perfectly. It's just how vim works.
Okay thats great info thanks @ninrod, can you explain the combination ie whats happening on each key stroke it helps me internalize whats happening, still seems weird that it starts with y ?
I'd recommend you complete vimtutor (cli tool, comes with vim)
yes, vim tutor is a must. also, just type learning vim
in youtube. there's loads of stuff there. Of special interest I'd recommend you pay close attention to text objects
. Finally, this site is an excelent resource: http://vimcasts.org/
when using . to repeat the last surrounded word it will not surround the correct with and will insert at the width of the first word you surrounded, see below example.
This may be a limitation but stack overflow suggested it may also be a bug so thought I would report it.
https://emacs.stackexchange.com/questions/36046/evil-surround-repeat-varying-on-varying-width-text-possible?noredirect=1#comment56820_36046