Created
June 23, 2023 05:51
-
-
Save Thilakeswar/f8b4160d5d09d4e01150541626576292 to your computer and use it in GitHub Desktop.
Some useful vi commands that I had used
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
* Search and replace across multiple lines : | |
:%s/<SearchString>/<ReplaceString>/g | |
Eg: :%s/Vijay/Thalapathy/g | |
* Delete multiple lines based on SearchString : | |
:g/<SearchString>/d | |
Eg: :g/^Garbage.*$/d | |
* Delete multiple lines based on range : | |
:<StartRange>,<EndRange>d | |
Eg: :1,13d | |
Delimiter meaning | |
%s - Search | |
g - global | |
d - delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment