Vim Tips Wiki

FileName Completion in Shell Scripts

1,624pages on
this wiki
Add New Page
Talk0 Share
Tip 196 Printable Monobook Previous Next

created 2002 · complexity basic · version 5.7

In shell scripts, you often define environment variables for different directory names, for example:


Normally typing Ctrl-X Ctrl-F is used to complete FileName under cursor. But this does not work if used on lines given above.

This is because Vim treats "=" sign as a valid filename character.

Since the actual possibility of "=" being in any filename is very less, this char can be removed from the list of valid filename char.

set isfname-==

Putting the above line in vimrc will remove "=" from the list of valid filename chars.

Thus you can easyly complete filenames using <Ctrl-X> <Ctrl-F>


For source code editors of Progress, based on this tip, I used

set isfname-={,}

and now my include files are pulled in automatically with gf when they are in the format {myinclude.i}

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki