From the course: Learning Vim
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Windows and buffers
- [Instructor] It's very common to work on more than one file at a time. Vim supports editing multiple files as well. But you need to understand the terminology of it. A buffer is the content of the file being edited. It can be a new file, or a file that's already exists on disk. All the changes you are doing to a buffer will only be written to disk if you save the buffer. A window is a view to a buffer. You can have several windows pointing to the same buffer in different places. Let's have a look. Vim perfect.txt. Now open a new window to the same buffer with :split. Say you'd like to add where the first quote came from. Find the location with /P enter and move to the end of the file with dollar and enter insert mode with "a". And now write. And this quote is from Zen and the Art of Motorcycle Maintenance. As you can see, the bottom window is updated as well. Let's move to the end of the current window. Escape and then Shift + G. As you can see the bottom window did not change. You…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Windows and buffers1m 54s
-
(Locked)
Challenge: Buffer12s
-
(Locked)
Solution: Buffer28s
-
(Locked)
Edit files2m 12s
-
(Locked)
Challenge: Edit files10s
-
(Locked)
Solution: Edit files23s
-
(Locked)
Move between buffers1m 28s
-
(Locked)
Challenge: Switch buffer9s
-
(Locked)
Solution: Switch buffer22s
-
Read command1m 29s
-
(Locked)
Challenge: Insert file6s
-
(Locked)
Solution: Insert file13s
-
(Locked)
-
-
-