4 # File ID: 2c77e8de-5d3d-11df-8a6a-90e6ba3022ac
5 # Inserts fold marks in HTML source before and after stdin.
6 # Select text in visual line mode and filter the block through this script.
11 our ($opt_c, $opt_h) =
13 getopts
('ch') || die("Option error, use -h for help.");
20 my ($Indent, $Title) =
23 defined($ARGV[0]) && ($Title = join(" ", @ARGV) . " ");
24 $Line =~ /^(\s+)/ && ($Indent = $1);
25 my $c_S = $opt_c ?
"" : " -->";
26 my $c_E = $opt_c ?
"" : "<!-- ";
27 print("$Indent<!-- $Title\x7B\x7B\x7B$c_S\n$Line");
33 print("$Indent$c_E$Title\x7D\x7D\x7D -->\n");
39 Usage: $0 [options] [Fold_text]
41 Adds Vim fold markers around text read from stdin, hidden by a HTML
46 -c Also comment out the text from stdin instead of creating folds only.