1
00:00:00,050 --> 00:00:02,040
- [Instructor] Open new.txt,

2
00:00:02,040 --> 00:00:05,090
vim new.txt.

3
00:00:05,090 --> 00:00:08,090
Say you'd like to replace you with they.

4
00:00:08,090 --> 00:00:10,030
Here's how you do it.

5
00:00:10,030 --> 00:00:15,090
Column S replace you with they and enter.

6
00:00:15,090 --> 00:00:19,070
As you can see, only the first occurrence was replaced.

7
00:00:19,070 --> 00:00:22,070
The second you was not replaced.

8
00:00:22,070 --> 00:00:24,020
If you'd like to replace all,

9
00:00:24,020 --> 00:00:26,030
you need to add the G switch

10
00:00:26,030 --> 00:00:28,000
to column S.

11
00:00:28,000 --> 00:00:30,010
Undo with U.

12
00:00:30,010 --> 00:00:35,030
And now, column S/you/they and slash again

13
00:00:35,030 --> 00:00:39,000
and g for global replacement search, enter.

14
00:00:39,000 --> 00:00:40,010
And now you see that both

15
00:00:40,010 --> 00:00:43,070
of the occurrences of you was replaces with they.

16
00:00:43,070 --> 00:00:46,040
Sometimes you'd like to confirm a change.

17
00:00:46,040 --> 00:00:49,090
This can be done with the C flag to column S.

18
00:00:49,090 --> 00:00:52,070
Let's undo again with U.

19
00:00:52,070 --> 00:00:58,030
And now column S slash you with they,

20
00:00:58,030 --> 00:01:00,040
global and confirm

21
00:01:00,040 --> 00:01:01,040
and enter.

22
00:01:01,040 --> 00:01:04,000
And now Vim will ask, would you like to change this one,

23
00:01:04,000 --> 00:01:07,000
I'll say no to the first, and yes to the second.

