I'm trying to use the Search command in Vim:
:Rs/F/T/X
R = range
F = text to find
T = text to replace with
X = options
But, when I want to search for the "." (dot character) I'm getting some problems.
The task: Replace all occurences of " ." (space dot) for ">" (greater-than)
So, first I tried this:
:%s/ ./>/g
But this changed me all the " ." (space ANY-CHARACTER) to the ">" character.
Then I remembered that the dot character is a special one, so I tried this:
:%s/ \./>/g
But vim threw me an error: E486 Can't find pattern " \."
And finally I tried this crazy thing:
:%s/" ."/>/g
and this :%s/" \."/>/g
But I got the same result: E486 Can't find pattern...
PS: Sorry for my poor English.
Both a space and a dot are special characters. Try this:
:%s/\s\./>/g
Update: \s is used to represent all whitespace characters (space, tab, line break), not just a space.
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