I have been using Vim for around 15 years, and yet I continue to find new features or commands. Just this week I found the gf command. When the cursor is on a file name (and you are in command mode) typing gf will make vim try to open the file named under the cursor. gf (think goto file). This is great when editing software sources where ther are often files included within other files. Vim allows control over what paths are searched, for the case where the file name under the cursor is not a full path. There are a couple of values used: path lists paths to search, and includeexpr can be used to manipluate the path.

Loading Conversation