I cannot figure out the general rules for using
% to substitute the current file name/path into a command line mode command.
Here are examples.
I create a file
te st.txt, open it in vim and try to save a copy named
:w %.backup. This works as expected.
From the same file, I try to print it to a PostScript file with
:ha > %.ps. This time, instead of
te st.txt.ps, I get a PostScript file
If I do
:exe "ha > " . expand("%") . ".ps", I get
I do not follow the rules for using
% in command line.
Are they documented somewhere?