[ACCEPTED]-Easily open include filenames in vim?-text-editor

Accepted answer
Score: 13

Use the gf shortcut. Move your cursor on a 18 path string, the exact cursor position is 17 not important and then press gf in normal 16 mode. gf stands for "goto file".
See vims help 15 page with :h gf:

Uses the 'isfname' option to find out 14 which characters are supposed to be 13 in a file name. Trailing punctuation 12 characters ".,:;!" are ignored. Uses 11 the 'path' option as a list of directory names to 10 look for the file. Also looks for the file relative 9 to the current file. Uses the 'suffixesadd' option 8 to check for file names with a suffix 7 added. If the file can't be found, 'includeexpr' is 6 used to modify the name and another 5 attempt is done.

To get back, use Ctrl-o in normal 4 mode.
Note: This command brings the cursor position 3 to older positions in the jump list. The 2 opposite command is Ctrl-i which brings the cursor 1 to newer positions in the jump list.

Score: 5

Put the cursor on the filename, then Ctrl+wgf

:h ctrl-w_gf


More Related questions