October 2015
Intermediate to advanced
356 pages
7h 54m
English
| Tip 43 | Open a File by Its Filename Using ‘:find’ |
The :find command allows us to open a file by its name without having to provide a fully qualified path. To exploit this feature, we first have to configure the ‘path’ setting.
We can always use the :edit command to open a file by providing its full path. But what if we’re working on a project where the files are nested a few directories deep? Entering the full path every time we want to open a file can get tiresome. That’s where the :find command comes in.
We’ll use the files/mvc directory to demonstrate. The source files are distributed with this book. In the shell, we’ll launch Vim from the files/mvc directory:
| => | $ cd code/files/mvc |
| => | $ vim index.html |
Let’s see what happens ...