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

Edit files - vi Tutorial

From the course: Learning Vim

Start my 1-month free trial

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…

Contents