In gVim in windows, I want to map a command in the vimrc file that uses the current file (%). I write something like:
map <F5> !mycommand %
But then, when gVim first loads, it runs vimrc and says that it cannot find the current file, because it is not opened yet. How can I map this in the vimrc, but make it parse the % command only when I hit F5 (after I have opened a file)?