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.

Open files from name

Open files from name - vi Tutorial

From the course: Learning Vim

Start my 1-month free trial

Open files from name

- In many cases I work with files that reference other files. If you look at "index.md"; Vim index dot md. You will see a list of files. Lets go to "new.txt"; So file, slash, new and enter. We can now copy the file name and open it, but instead of that we can use "gf", which stands for "go to file" and the new file will be opened. If you have an error from a compiler, such as in "error.txt" so colon e for edit, "error.txt". This is a very common format. We see the file name, the line number and the offending column. "gf" will open the file, but if you use g, shift, f, it will open the file in the right line. So g, shift, f, and we open the file in the right line number. Very handy. If you have "wget" or "crn" installed, you can even fetch URLs. Switch to "index.md". So, "b" buffer, "IN" and then tab and Vim will complete the file name. Now enter. Lets go to the bottom with shift, g. And then, w, w, w you get to the url. And now if you do "gf" Vim is going to fetch the sources and if…

Contents