Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does :%S do in vim?

Tags:

vim

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?

like image 350
René Nyffenegger Avatar asked Jul 06 '11 04:07

René Nyffenegger


People also ask

What does S do in Vim?

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.).

What does the ZZ command do in Vim?

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.

What does e do in Vim?

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.

How do I jump to a specific line in Vim?

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.


1 Answers

:h :S

:[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
like image 157
Don Reba Avatar answered Oct 12 '22 05:10

Don Reba