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.
Edit files
- [Instructor] When you start Vim with no filename, it will open a window into an empty buffer, Vim. If you'd like to edit a new file, you can use the :edit, or shorter, :e to open a file. So, :e tools.txt. When you'd like to edit another file, you can use :e again. :e new.txt. Where did the first file go? It is still there in the buffer but there is no window showing it. You can delete the current buffer with :bd for "buffer delete". And we're back in the first file. If you have several files on disk, you can use :e space and then tab, to go over the list of files. Lets do an Escape. Another option is to start with a prefix, So :e d and then tab will show us the files that starts with d. And Escape again. Another option is to open a directory. . is the current directory. So, :e and then . and we see a list of files in the current directory. You can use j and k to move between the files, and you can use / to search for files, /success. And once you are on a file, hit Enter to edit the…
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)
-
-
-