:%s/ / Ctrl v Return /g
Where Ctrl v is the control key plus the v key and Return is the return key (the one on the main keyboard, not the enter key on the numeric keypad). Other characters are printed as usual.
If entered correctly, the sequence Ctrl v Return will be displayed as ^M characters, usually of a different color, to indicate that they are special. Note that actually ^M input will not work.
Also note that in Vim for Windows it is Control-q instead of Control-v (how to insert this).
Ctrl-v also allows you to enter other "special" keyboard keys. It is also useful for e.g. Tab or Backspace.
sleske Jun 26 '09 at 11:36 2009-06-26 11:36
source share