1
00:00:00,050 --> 00:00:02,020
- [Instructor] You can define your own marks

2
00:00:02,020 --> 00:00:03,060
and jump to them

3
00:00:03,060 --> 00:00:05,040
and this is very handy.

4
00:00:05,040 --> 00:00:07,000
To make things even nicer,

5
00:00:07,000 --> 00:00:09,090
Vim defines some automatic marks for you.

6
00:00:09,090 --> 00:00:13,060
One of the most useful ones is the dot.

7
00:00:13,060 --> 00:00:16,060
The dot mark is updated to the last line

8
00:00:16,060 --> 00:00:18,070
where you made the last change.

9
00:00:18,070 --> 00:00:19,080
Say you're Mark Twain

10
00:00:19,080 --> 00:00:21,060
writing yet another great book.

11
00:00:21,060 --> 00:00:23,010
You edit the first chapter.

12
00:00:23,010 --> 00:00:26,030
So vim yankee one dot txt.

13
00:00:26,030 --> 00:00:30,080
You're up to line 47 so call on 47, enter.

14
00:00:30,080 --> 00:00:32,070
And you want to change it to,

15
00:00:32,070 --> 00:00:35,020
and you want to change I sat by my fire

16
00:00:35,020 --> 00:00:38,010
to I sat by my fire at the Warwick Arms.

17
00:00:38,010 --> 00:00:41,010
So, slash comma

18
00:00:41,010 --> 00:00:43,040
to get to the first comma.

19
00:00:43,040 --> 00:00:45,060
Insert to get to insert mode

20
00:00:45,060 --> 00:00:47,050
and at the,

21
00:00:47,050 --> 00:00:50,000
and then you forgot how you wrote Warwick.

22
00:00:50,000 --> 00:00:52,080
So, escape to go back to normal mode.

23
00:00:52,080 --> 00:00:54,060
Then we search by quotes

24
00:00:54,060 --> 00:00:59,030
with question mark and then war.

25
00:00:59,030 --> 00:01:00,030
We get Warwick.

26
00:01:00,030 --> 00:01:04,040
We copy it with yw and then we go back

27
00:01:04,040 --> 00:01:06,030
to where the last change was

28
00:01:06,030 --> 00:01:09,040
with single quote dot.

29
00:01:09,040 --> 00:01:11,030
Now we go back to the comma,

30
00:01:11,030 --> 00:01:13,060
forward slash, comma, enter,

31
00:01:13,060 --> 00:01:16,090
and shift + b to paste,

32
00:01:16,090 --> 00:01:19,020
a to enter insert mode

33
00:01:19,020 --> 00:01:22,030
and Arms and we are done.

34
00:01:22,030 --> 00:01:25,030
I use the dot mark a lot when working with text.

35
00:01:25,030 --> 00:01:27,050
I hope you will find it useful as well.

36
00:01:27,050 --> 00:01:29,040
There are several other special marks.

37
00:01:29,040 --> 00:01:32,000
You can view them in the wiki.

