Vim Tips Wiki

FileName Completion in Shell Scripts

Redirected from VimTip196

1,614pages on
this wiki
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}

Around Wikia's network

Random Wiki