I know the separate answers. For example,
- To open several files:
- To save
*.f90file to HTML:
However, I don't know how to combine both of them.
After you've added your files to the arguments list with
:n ./**/*.f90 (
:args + filenames would do the same thing and is perhaps more obvious) you can use:
:argdo exe 'TOhtml' | wq
:argdo will execute its following commands for each buffer that's in the argument list. Note that you need to use
:execute since it isn't defined to allow a following
:execute allows you to work around this.
You may wish to modify the
:w command to write the generated HTML buffer into another directory (e.g.
w html/%). And it's probably a good idea to close each generated window as you go with
:q so Vim doesn't run out of room for windows if you have lots of files to process.
I would suggest the following combined command:
:args ./**/*.f90 | argdo execute TOhtml
args to fill the argument list, then use
argdo to execute the
TOhtml command. There should be no reason to
wq, since there is no change to the files, thus I would instead do e.g.
:qa when you were finished and happy.
As pointed by "Karl Yngve Lervåg" in his comments, combining the answers of both "Karl Yngve Lervåg" and "Antony" gave me the desired result.
So, after opening the first .f90 file, you should use the below command
:args ./**/*.f90 | argdo exe 'TOhtml' | wq
The only trouble which I am still facing with the above method is: generated html files doesn't have colors of vim (except for the first .f90 file).