Find and replace, Vim tips

1. Find each occurrence of ‘old’ (in all lines), and replace it with ‘new’.


2. Find each occurrence of ‘new’ (in the current line only), and replace it with ‘old’.


3. Change each ‘old’ to ‘new’, but ask for confirmation first.


4. Change each ‘new’ (case insensitive due to the i flag) to ‘old’; ask for confirmation.


5. Change each ‘old’ (case sensitive due to the I flag) to ‘new’; ask for confirmation.


6. How to do a find ‘old’ and replace it with ‘new’ only in lines 10 to 70


A %d blogueros les gusta esto: