As I tried to globally replace FOO with BAR in a vim buffer, I accidentally typed
:%S/FOO/BAR/
Note the uppercase S
instead of the more suitable s
.
Of course, it wouldn't replace my FOOs. That's understandable. Yet, vim split the window into two windows, both holding the same buffer.
Unfortunately, I was unable to find any :help
on this behaviour. So, can someone explain what the uppercase :%S
is supposed to do and where I can find help on it?
s (substitute) will delete the current character and place the user in insert mode with the cursor between the two surrounding characters. 3s , for example, will delete the next three characters and place the user in insert mode. c (change) takes a vi/vim motion (such as w , j , b , etc.).
zz places the line in the middle of the buffer. zt cursor line at top of the window. zb cursor line at bottom of the window.
1 Answer. Show activity on this post. "Changed outside of Vim" means that the file that you're editing has been written to by another program. :e will load the latest version, and :e! will do that even if you have unsaved changes.
If we are in the vim editor, then simply do this, “Press the ENTER key, write the Line number, and press Shift+ g”: Again the output is the same.
:h :S
:[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With