Open filenames containing spaces with gf
From Vim Tips Wiki
Tip 1212 Previous Next Created: April 20, 2006 Complexity: basic Author: Christian Brabandt Version: 6.0
One great feature of Vim I personally use a lot, is using gf for navigating within Vim and opening other files. Unfortunately Vim cannot out of the box handle file or path names that contain white space. If you want to be able to open filenames names that contain whitespace you need to adjust the isfname option.
This option specifies which characters are valid for filenames. If you want a blank to be considered as a valid character for filenames, add the following to your vimrc:
:set isfname+=32
This adds the ASCII character decimal 32 (space) to the allowed characters.
[edit] References
[edit] Comments
Or select any/partial filename with v<move> and press gf
<cursor-at-start-of-filename>v<move-to-end-of-filename>gf
