1
00:00:00,050 --> 00:00:02,000
- [Instructor] Let's open some files.

2
00:00:02,000 --> 00:00:04,090
Vim tools.txt.

3
00:00:04,090 --> 00:00:13,020
And then :e new.txt and then :e and sleep.txt.

4
00:00:13,020 --> 00:00:15,000
To view the current list of buffers,

5
00:00:15,000 --> 00:00:18,020
use :ls and then enter.

6
00:00:18,020 --> 00:00:23,070
You can move between buffers with :bn and enter.

7
00:00:23,070 --> 00:00:27,070
:bp and enter to move to the previous buffer.

8
00:00:27,070 --> 00:00:30,020
This will rotate between files.

9
00:00:30,020 --> 00:00:32,010
To find out the name of current file,

10
00:00:32,010 --> 00:00:35,050
you can use Control + G and you will see below

11
00:00:35,050 --> 00:00:38,020
on the status line the name of the file.

12
00:00:38,020 --> 00:00:39,080
To move to a specific buffer,

13
00:00:39,080 --> 00:00:47,000
you can do :b space and then the file name tools.txt.

14
00:00:47,000 --> 00:00:50,050
You can use :b space and then Tab

15
00:00:50,050 --> 00:00:55,080
and Vim will help you with a list of buffers.

16
00:00:55,080 --> 00:00:57,060
If you're stuck with a prefix,

17
00:00:57,060 --> 00:01:00,090
Vim will match only the buffers that start with that prefix.

18
00:01:00,090 --> 00:01:05,050
So :b space T and then Tab

19
00:01:05,050 --> 00:01:09,090
will bring us tools, and then enter to select the buffer.

20
00:01:09,090 --> 00:01:11,060
If you look at the list of buffer

21
00:01:11,060 --> 00:01:14,070
with :ls and enter you will see

22
00:01:14,070 --> 00:01:17,050
there is a number for every buffer.

23
00:01:17,050 --> 00:01:21,090
You can switch to a buffer by its number, :b and 2.

24
00:01:21,090 --> 00:01:23,060
I find this handy when the list

25
00:01:23,060 --> 00:01:28,000
of buffers is big and many of them share a common prefix.

