Reputation: 394
Hi I want to replace the occurrence of [x] with [] in vi editor
I have used the following command
:%s/[x]/[]
and it gives me [[]], how to update my command so that I get desired result.
Upvotes: 0
Views: 53
Reputation: 1520
You can replace:
:s/\[x\]/[]/
:s/\[x\]/[]/g
:%s/\[x\]/[]/
:%s/\[x\]/[]/g
(Obviously you must make sure you are in command mode, use the esc-key for this)
Upvotes: 2