A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label comments. Show all posts
Showing posts with label comments. Show all posts

Table parsing, old friend

Some comments I found in code once:

    # Table parsing, old friend... We have spent many long evenings together,    
    # working through your broken tables, talking about your issues with         
    # implicit thead elements, and your quirky tr/th heuristics. But ... but     
    # but it's time for us to move on. We can't keep doing this. It's not you,   
    # it's me...                                                                 
    #                                                                            
    # I've ... I've met someone new. She's beautiful, she's modern, and she's    
    # elegant. She's logical, she's clean, and she's well-structured, if you     
    # know what I mean...                                                        
    #                                                                            
    # She always puts a single tr in her thead's, and what's more, she's always  
    # got a thead. Her tbody's support her tr's, and she never forgets them.     
    # Life is simpler now. Better. Less miscommunication, fewer arguments over   
    # what defines a header row. Sometimes it lasts in parsing code, but         
    # sometimes, it hurts instead...                                             
    #                                                                            
    # IF YOU EXTEND THIS CODE TO SUPPORT YOUR BROKEN HTML
    # TABLES I WILL FIND YOU. YOU HAVE BEEN WARNED!  

Thanks to Pete for much amusement.

Toggle comments in vi

Add a comment for one line only:
&

Vim features


  • Auto-complete (for Perl files): start typing, then press Ctrl-Shift-P

Nested comments

Are your comments disappearing when you wrap them with a <xsl:comment> tag?

They may already be inside a comment.

vi syntax higlighting

Use

:set syn=perl
:set syn=tt2

and

:highlight Comment ctermfg=Green guifg=Green