Using vimdiff, I can compare two files and generate it's corresponding HTML via the following command:
: TOhtml | wq | q | q
(the wq
will save the Diff.html
file, and the two q
s will quit out of the two vimdiff
ing files.)
Before I output to the Diff.html
file, I'd like for all of the folds (places where code is identical between files) to be expanded.
I'm trying to run a command in Vim, like so:
:normal zo | TOhtml | wq | q | q
However, the result is not what I expected. The above multi-command will only expand the folds (via zo
); that is, it will ignore TOhtml
, wq
, q
, and q
. I have to use the normal
command because zo
is a normal-mode command, as opposed to a execute-mode command. It seems that when chaining commands after the normal command, the latter commands will not execute.
Edit: Although it appears you cannot have execute commands after a normal
command, you can have a normal
command after an execute command. For example:
:q | normal zo
will in fact quit out of the first file's diff and then expand all folds in the remaining file's diff.