1
00:00:00,050 --> 00:00:03,000
- [Instructor] Out of the box, Vim is very powerful,

2
00:00:03,000 --> 00:00:05,000
but one of Vim's main strengths

3
00:00:05,000 --> 00:00:07,030
is the amount of customization you can do.

4
00:00:07,030 --> 00:00:08,060
You can add commands,

5
00:00:08,060 --> 00:00:09,050
map keys,

6
00:00:09,050 --> 00:00:12,000
and even write extensions in various languages

7
00:00:12,000 --> 00:00:14,090
such as Vimscript, Python, and more.

8
00:00:14,090 --> 00:00:16,080
Depending on your operating system,

9
00:00:16,080 --> 00:00:18,040
Vim's configuration file

10
00:00:18,040 --> 00:00:20,030
will be in a different location.

11
00:00:20,030 --> 00:00:21,040
On Mac and Linux,

12
00:00:21,040 --> 00:00:25,000
it's .vimrc under your home directory.

13
00:00:25,000 --> 00:00:25,090
On windows,

14
00:00:25,090 --> 00:00:31,050
it will be c:/users/<yourlogin>_vimrc.

15
00:00:31,050 --> 00:00:33,040
If you work on many systems,

16
00:00:33,040 --> 00:00:35,030
try to avoid too much customization

17
00:00:35,030 --> 00:00:36,090
in your vimrc file.

18
00:00:36,090 --> 00:00:39,000
It will make it hard to use vanilla vim

19
00:00:39,000 --> 00:00:41,020
on other systems you are using.

20
00:00:41,020 --> 00:00:44,010
Vim users create their vimrc for years.

21
00:00:44,010 --> 00:00:45,080
Mine is 20 years in the making

22
00:00:45,080 --> 00:00:47,080
and I'm still tinkering with it.

23
00:00:47,080 --> 00:00:49,040
Let's try a small example.

24
00:00:49,040 --> 00:00:52,080
Vim hello.py.

25
00:00:52,080 --> 00:00:54,060
If you'd like to see line numbers,

26
00:00:54,060 --> 00:00:56,060
you can set his option with

27
00:00:56,060 --> 00:01:01,020
:set number and enter.

28
00:01:01,020 --> 00:01:04,070
:set can be abbreviated to :se

29
00:01:04,070 --> 00:01:07,080
and number can be abbreviated to nu.

30
00:01:07,080 --> 00:01:10,010
If you'd like to switch off line numbers,

31
00:01:10,010 --> 00:01:12,070
add the no before the option.

32
00:01:12,070 --> 00:01:15,020
Set, no, nu.

33
00:01:15,020 --> 00:01:17,040
And the line numbers are gone.

34
00:01:17,040 --> 00:01:19,080
If you'd like this setting to be permanent,

35
00:01:19,080 --> 00:01:21,060
edit through your vimrc.

36
00:01:21,060 --> 00:01:23,010
I'm on a Mac so,

37
00:01:23,010 --> 00:01:27,070
edit home directory .vimrc.

38
00:01:27,070 --> 00:01:30,080
And now, I to enter insert mode

39
00:01:30,080 --> 00:01:34,010
and write set number.

40
00:01:34,010 --> 00:01:36,090
The language of vimrc is called Vimscript.

41
00:01:36,090 --> 00:01:40,050
In Vimscript, we start comments with double quote.

42
00:01:40,050 --> 00:01:43,060
Show line numbers,

43
00:01:43,060 --> 00:01:46,000
and now save and exit.

44
00:01:46,000 --> 00:01:51,010
Escape for normal mode, :wq enter.

45
00:01:51,010 --> 00:01:53,080
And now, when we open the file again,

46
00:01:53,080 --> 00:01:55,040
vim hello.py

47
00:01:55,040 --> 00:01:57,000
we will see the line numbers.

