diff --git a/vim-commands b/vim-commands index cbaec9a..fc67c48 100644 --- a/vim-commands +++ b/vim-commands @@ -465,3 +465,41 @@ Line mode: Pressing " with "y" command and then using "/" will leads to yanking(copying) from the current cursor position to the next occurance of the . + + + @ Command : [range]s///[flag] (Its a line command) + ^ ^ + | | + optional optional + + + What does it do? + + It replace the occurance of old string to new string over the range + in the file. + + [flag] + + * g : It represent to replace all the occurance of to in + current line where the cursor is present. + + + [range] + + Define the range of this command. Could be single line, multiple line + and even all the lines in the file, etc. + + * : On which line number this command to be executed. + + * , : From the starting line number + to the ending line number to + to execute the command. + + For ex: + :1s///g + + It will replace with in the entire line of line number 1. + + :1,5s///g + + It will do the same form line number 1 to 5.