History
Article Edit this page Discussion

Open filenames containing spaces with gf

From Vim Tips Wiki

Jump to: navigation, search

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

Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto Wiki
Doctor Who
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Mystery Science Theater 3000
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"Open filenames containing spaces with gf"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation