replace a word in vim editor
hai
I am using vim editor and i want to know how can i replace all occurance of a word with an other word? is there any built in command in vim to do this? |
you have help in vim
while in command mode try: :h replace |
Hi,
In command mode: :%s/THIS/THAT/g This will change all instances ofTHIS in THAT. the % is the line range (% = all), you could also do this: 5,15, which will change occurences in lines 5 to 15 (included). The g on the end makes sure that all occurences in one line are changed. If you don't use the g, only the first instance will be changed. Take a look here for a short vi tutorial: vi tutorial Hope this helps. |
thankx for ur help it solved my problem
|
All times are GMT -5. The time now is 05:32 PM. |