Created
June 3, 2015 05:49
-
-
Save murarisumit/0e205bd544d9e193372d to your computer and use it in GitHub Desktop.
Search and replace in Vim
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find for sting in vim | |
/searchString | |
"press n for cursor on next occurence of string | |
"Press N to move cursor on previous occurence of string | |
================================== | |
Replace in vim: | |
"Replace All occurence of string in current line : | |
:s/srcString/destString/g | |
"Replace All occurence of string in current line(case-insensitive) : | |
:s/srcString/destString/gi | |
"Replace All occurent of string in complete file: | |
:%s/srcString/destString/gi | |
":% is the same as a range of 1,$ which equates to the entire file | |
=================================== |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment